/*******************************************************************/
/* @ All Rights Reserved Copyright (C) 2014 broada,Co.,Ltd.        */
/*                                                                 */
/*  NAME      = t_rtp_analyze.c                                   */
/*  NOTE      =                                                    */
/*  DATE      = 2016/02/17 by songbb                               */
/*******************************************************************/

#include <CUnit/Basic.h>
#include <stdlib.h>

#include "frcomm.h"
#include "frmem.h"

#include "../../../src/module/rtp/config.h"
#include "../test_rtp_comm.h"
#include <rtp/rtp_core.h>
#include <rtp/rtp_header.h>
#include <rtp/rtp_comm.h>
#include <frct_comm.h>
#include <apmtest_comm.h>
#include <frreport_opt.h>
#include <frcomm.h>
#include <frvar_field.h>

extern void __rtp_add_error_nums(L7session_rtp *p_st_sess);

static int __suite_init(void)
{
    return 0;
}

static int __suite_cleanup(void)
{
    return 0;
}

/**
 * 正常测试
 * 共一个帧，序号从119到123
 */
static void __case1(void)
{
    Frlist_node *p_st_node = NULL;
    Frvar_field *p_st_field = NULL;
    Conntrack *p_st_conn = NULL;
    CU_ASSERT_EQUAL(test_rtp_create_ct(&p_st_conn, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT), FR_SUCC);

    // seq 119
    char *p_bin = (char *) "8060007700008ca00000099d000001ba44000c650401028f63f8";
    char arr_payload[65536] = {'\0'};
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    unsigned int ui_payload_len = strlen(p_bin) / 2;
    Apm_packet *p_st_packet = NULL;
    struct timeval st_timestamp;
    st_timestamp.tv_sec = 1454549354L;
    st_timestamp.tv_usec = 123456L;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    Frhash_header st_hash_report;
    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 120
    p_bin = (char *) "8060007800008ca00000099d000001e0054e8c800521000319410000000161f205450af09f71ef068892fdadf7a63239857bf798ab20b3a921813a6a4d8ba324e9ac5e094693ac253408e102bafbffc4f3474cfdfc993697920b1e047955996b9304faef708f363197f7cec97a6e909c5a34518d72609aa87fd9a33447a951b242b931f8ad64e582b72d804acdb81e469ef7c8707d1e03d48ff6197ab4125e3a040755db0bff9b2fb1f6424e2d25f43eaf75076f3c3a26ea45e9fc02a3a21d034dc958d9d94d2427b109ae75d63ca2a5f4ca322fa62dc877f9784bb2eca88e480bee07a54d79ddf14ba9b961c8fe2bb872b7ecd73466ffdf378febe123c67fdae1a56cf58de459e86384bdbd74ee2b420555932df3513b5e216a3ce0408c7b0d5c261ab9d465437734c944a51653b74926f703bda631d69c051ab84d9cfab519cc695f2a3e1023d6ee9567cb390a1b65a02436afed0ccfaabddc477dffaea571309ffe826fe1445fdf9cde3fefcff7cb3b29918fde35eb182f2c206df86eac1f06035db2e07bc9e66feef92d4bcaa1573ae845eb5c4f88707236ff92c0cf44710875cbcbc77d46df44a45a6f7ccdcac6977256116df6ab222e6923bb7f91c9e1f8f4ea38dd3e01f58f1b96cd33d8fb669577c92c1143cfbc4e4aaad66a9dadbe49b10435afee8f057c9b9391d9b46c15da2b2b31c4d65e471ccf419ab0dd49c15ba7c42aed5e6578256f5bf170e0cd1e46e561a10a353867dea5c7b3ebb91416118e35eb9b08870bd7be2b31887168a1423060469f7ae581233cae7feaaad3d6239b84c34d742f3470e13075adffc26e98c4ada6a7893be1960afc5a9760d62227c79256aaf1b5846f6bb91745cb46553ee99cd3588edb79b89acceb93914d29353fd277ee5e4f2191d8f4aeb692c4ded77ad2a6bed784355bf7babfb8ebe2dc8167e6718fa2c5b7e3354ab88e48774f47d6c4a471e373862f93ef082fef13cceccfff2633ffd4eb5d2bfc523cce7635920dc6c672c5563b73af8574565f6e66be979355b8ae4a525c7bd667bcbc329e6b3975fe909ed8fc22785ef155a5f22ea35ad535e47dc6724732fea6e63408db597f08ac0905c8d05b5208b73a6c1ffc177b75cd8ebeee8f8fe534051fcab61daea66cd73655e3603acd09f1e68a6ee3cd0e20f9735988342acd19e1d9e525f6834cb68469aa682351278f4c80f5d9e5a46eff735f3782cced5770a72c936a8d2fdff78ee46e925bae655cfdd147ebd2ea2f8a5844fae03b2f537c65cf13ca30c55f64807f7ae87ff24cfb32e5565b347262e2f88782fa1b0a3afd2be3f085bbfbf76e398efe4b2ada56f37a9237fab40f22718f32ffbcf069f7e47165b4bd528a5849c71844b3a256bd2d3452a8b50b5e3b92f546b99969a445bc9cd2d2953ded3ff221a88a7e977b71ec1bb73dda3ad46249e3052cc69089b469246a538c2f79170c5ac5e2ef1545aa8f6104df2b519a4debb0c5d38236996d86e7cbbef8476b90a6ef5e4efcd1d8846b883fef22131db7b8c675770c3c605cdf5dbebcd6ce5d83493cdd1962970e26c41d4c4df4e17e672948dcc56642d001fa683ea806960e15cebe318aee59d8206d2b342f215da8b803eeeb0a9ae8325a8ab45c8e8edce2563eca9cad98e9c0315f43562b71e5e0ab4556f96fe5d2618f642ab7c92eb5939234bee7d4577835ac7225c7254430fe28bc566dd48f23bf463f1391aa3fa32999f2dee5ee3431ee234cca1644d77743f195a112b656a74934dda6922fa2da331acd74dc29f7c9011adf5af2494477badd192cb97beb4b9665817cd4071e4b6fcad1023c820976523583cf5f760ee44b274ea9144cd4c96e9e3a448c4aff6f9b8df613e23c54f1b8644faf967c3e79e3370c0ad7e317fddb81eadf0524c18209bb55fee6814080742066abdcd9cb0f";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 121
    p_bin = (char *) "8060007900008ca00000099d000001e0054e8c80052100031941c300c52e9eaf23fbaf0b58f026defc701cc3fff3a716cfe9d111c2bc7e2f97dcca7df8f312026db9b75ed2a6d3e989ad7f7d24ad731235f963ff336b9bef4735e068d4e03f23a956c4cd79755b85dfb63177af4aed0eb583577a05d0a99050c875961a71a05a7f2492a8c5ff6cdada2a5ff16a5a188d065a6eac8115c247c7e21c847ca602498cab3136f5b472feee506083a620fefa9f0b22cb1b2de861144690fef843fd62b2dcc7153ceb8ae46701eae65d9aa2b53ea734091e055031096b4511ce23f8866de105d6970868a89996d47e5799742e0c55dd95d073333e9e1971e8fafbd61b3290be5acbd3ad7ae66a8b8d23ef23808930abfe4185d84cf6edb93b7973d5285364031980820d3d44301236cab9d1d60b58067e697be39f7c170e08b6867fc0426670549fcebb857ded47ab65cdfcf80031de2d0dd53483dfce598d1b1ce06bae8c7db587840bb3cef2eb07c1cfe8b112a067f13dab61ea2e909d8c29bbd1ae58ecf685f01b2dfa022cd1292c847d706a27963ae1fa372bb026c81fec7e5bcb9e2322f94901abea7a733a8fff4a09196fb2a68a90655dc4858df4dfffec2d9707622eb9700bee928ce58e9a30a10c46e70e1ce3a32dbe0a850f2a53d1a969b3660737e0e55efc08c30790da531a0a170d0f025e2aee988b4c662283a460b8a2919e475cf775cca2e0da6ec562ea26cf9cd9612e67b76b8b814e7172ece1c6815797b6d3aeb4e1154fedc9b7e5938e530f3c522b11ba6854c8dac15c82d4ec6423e4d6a68b53218aa273a109aef72d8441a83b8e8fac72885eaf1926c2fedcd845c0946e7d1fe11bfae3cb73e16eba0848b888e29c97776aed0af5b6ea2981ebc7beeb013ed3dbdfb92e69eb984031bcec792a0f0d102340d849ab69031f684ccb5a4ccb786083fce84147d6fe80eb31f3995fe3dbf11b73788ddff8a3e0cb510a4396f1cf1b8ea0430263a656a044dff37e4f4cc4550cc08f5bb7028ff8b6b4b9928efd201f7c691ee85a55499665f74664300cddede3e68b1335c091d73792c6019a53aed20d21366bfc9f0e234c5c2a8b091385086b33dd3b32c2394d41ff69a9f6e0fefc1f0c7e2067efcd89f89fb04c63c5e16d4a5d9c387e583ba2c246082e0f77104d2d8336539f35175bf11d22443beb4593a9cbe77aa04c23639639e89efe11be1f2e249563d1ad6f806238ea3d1f3f0751f8f4c552c7f03f6ae1961eaf1a92335bb5ae4d9971a6ebc9ca68165d69f7c37c7c23c25a8c118875267d92e65f1eea6f92d8d437a12e4115073d1d189631cab12c15458c29d5f081ae84dc6e6d7decd2e2e108f97336b9b6b28d7b40cbec280ff1d671bcb4c919a8990fc930ebae7a1a484ccf4610b6176131231152d8c3fcb11f73100a36ed32c2c7b88104ce692db1f25cc3271f068929489594e12048c0b98deb07deff85ce2ae2e3cf8f089df5a91db5fb8fb3063dd98cc7cfabae4ada6ab589fdc9c87a47fb2f118efef0c90bdf8ca5ccb8fc190adc98c77da409163933b6e2baa9f2c05b9d81c16ec154d8cee2310ac38d8bff87f2ff97d690e988574a7f63e1c3163bbfd060c249a2306211717467c8765faf173c036cbea765f9c09c10e084e266da5c9d9f8a48c96fbadad7604f0889841968966bb48f2d12ac522a2d8b3889856fc6735cef6169f70a725f3655d8b930ca939b355aafd8ae661472aa3fb658d2f3a6f26723399ff78cd330ce5fd4489440eabfc6ea2162a9b452d13536c5ac9b544d57ecbcd45a721388f081783e19a150721dd854beabf968c6a2feb8c2702b04b35c626afb5704e3caab4a8cbdccfc2b3adb5909592c3e7f9db3458cfb4b7685bd3abcaeb8cbc9b89ee6626625e496a8a9ae2319df5ad5c4b8abed7e89a331827add797a";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 122
    p_bin = (char *) "8060007a00008ca00000099d000001e0054e8c800521000319412578df1c53337af0703398e69fd97ae9711a9b98c34d5437e9cfb8eefb28dd615de3974bf59a14f6eeedf516d791afefee5f4e0a57ed4ac820d5433c3a786b957ad26dfade45c84e6269c9d0c1889c50c31ce6c6ffaac36790b539f8ffb44e4eb217a372ccc67dfc0aa15ae597abc5b579f70df22574e575c53e19aa5b6aba90d1ff7c4b67583e7574ec5107975860455a21a494ecedf5e45a254111c75ac5fbc821e189e7077df7a52e5797acbe23ac0b6159b93b47b1178307d727a2fa350409f3c7a542f909dbd6309ccb464fa5732e2cfaf99e5a1e9d7af461197077d58b6438fb7dfa080c0f19dddad1e06f0f93433f75097ea466c69abdc12ee3b993dd12e2b77772d1efc20eeef6f77777d936bed0e8c1f4da4d1c18e66d36935c54f4fd53bf97d6bb490dc5f64425e8f7111ff08c2b9c7e25a4ab9cb1afd92d72a31b06f8848cd18ce86cdcc734f667e36f8dd7dbdb4b30314e5b0b99ac19b53d611d43fcc26f2ff1e9ddcec3bd9d97a3763c1984c6443c51a9b98a314672096d7e36ddf2fc1a84c445628ddc518a37799295290aaf3dfad9894d3b423f4ea60305c31631efce1c1469b0b6f6d6b08baf456d2355d2db7d5fbfcde1eade89d2e4ec6969acd63fee8251f950fcb77a688b30feffe8519c987af25d06033b48eba1ab632bdebb132fb429bf04ea5c8adbb7e4969af076171f3e0a33e2eac434d535078627c080101770fb2170f1d0b58a4769e36cdea38acf4a7b58ee88f4bc6a39e620d3817caf9f6d8c65f2ef0bf03731e915e56fde2e2fc6b4a59e98ff93b0853c79492d339ac52e435277ccaa2a955f51ee0f786b01931cc7d507c7e56461763a1548ccfdd54fc3c4937d8d86a077708ee15e551bb1fdff063e0fc325aaaf076193656278cc2baaaeb3514a1361169be5b2924401ad51d3aebc352d68b6ea322a2bc77c89facafd9421f21353a3ed27a8de13c05740ee76fcef7d5b509ea32b0546ac4d8eeb4a2535801d78809fcec13362cb83e023deadf8670f10590eae48d13ba33efe7a7466709f23f5f0017118edb675b640fb42cce6b016a2d36f6fca00023e59b0d471194db0538484bad29706aed5b0c7ae619c40eccc5c386be15f7ddef7beeb3226c12d6ab17b8dddea4330821a048a7eda262b324da6b409e8fc641b2c6cbdecb1a43924813139085d8314cdf83b82414917a392018f1c5e0ff4353c085aae53199a92bd5941d3b4b233c4d40f5bedb81c9e1f46c0eea9ffce2aa6b53eac34baa32b4d3db0ad6f70ced20e527a398a70cd0a44256daf584bc03bf248b14e6bccfd0325c9901ee97c1e02213137e9fcf2d58f426e427fbc5a876ed53133a7755345d6e5351519eb475c76e513737641356deea3d34f61e7eb122e2cae895357c2b22c2ce3ccfe584b0c4399612c1736dc961dac377bbc72e842ee30698ad4f8b777182273df1eafc9d58f0b1a9a2dc5809e0583bd2574d5134b8b1c64e5569816413beb05f18eaf130ab89d55f53a226ca6e0af33296a7887158c94401d98f9f86c9fb0181e05e62dbfefc8e1a742e5c762b66816d62c865b4761dfae58e9132708556ea62b79a45ceeafd164cc0c4c8bdf9ee876f94d6446e0b792997e2eb1afa2237d7df17275cb776a937c4560b3708ee4dfaadfaf50c3d60db71b788dc16d6337ff26e5fc4fa8cbc3d5842f1536217ebeb25f33bcf51359def1d593704358a5f177f72eab965ed609ef55bd44ee6bc1cf25c99aad57bf5aac4de4bffac8d7823bc25796bdccf482f6a5e5acf7f34f1436a4e5da37c2758a5d462be2b719cbced3757939b6a3f97bb45ff88b30ce59ef8e6ff70ee6cea88acfcc9a77adcd7862b1b59f91c33f9f08bbe17d4132eafbe398c3ba9b725e054bc9ca8906ed82e59b1f";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 123
    p_bin = (char *) "80e0007b00008ca00000099d000001e0004d8c80052100031941a849ed43fabdfa8ee578ec631fe2f195ba0ed1abb4a3f7c941e644eee731b2f34d72c9a356212f5cc9255bac13624cde7fea3d71cfda2df920ef1f16efedfb812afde55d60";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    p_st_conn->flg_has_master = FR_YES;
    p_st_conn->st_masterInfo.exp_src_ip = iptools_parse_ipaddr(TEST_RTP_SRC_IP);
    p_st_conn->st_masterInfo.exp_src_port = TEST_RTP_SRC_PORT;
    p_st_conn->st_masterInfo.exp_dst_ip = iptools_parse_ipaddr(TEST_RTP_DST_IP);
    p_st_conn->st_masterInfo.exp_dst_port = TEST_RTP_DST_PORT;

    unsigned long ul_invite_begin_timestamp;
    struct timeval st_timestamp_first;
    st_timestamp_first.tv_sec = 1454549154L;
    st_timestamp_first.tv_usec = 112233L;
    ul_invite_begin_timestamp = rtp_get_timestamp(&st_timestamp_first);
    char arr_invite_time[32] = {'\0'};
    snprintf(arr_invite_time, sizeof(arr_invite_time), "%lu", ul_invite_begin_timestamp);
    p_st_conn->st_masterInfo.p_lst_hdr_param = frlist_create();
    p_st_field = frvarfield_str(APM_SIP_INVITE_BEGIN_TIME, arr_invite_time);
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    p_st_field = frvarfield_str(APM_SIP_INVITE_PLAY_URI, "sip:42010606001320082255_1@10.72.1.125");
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    CU_ASSERT_TRUE(APM_L7_ANALYZE_IS_SUCC(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report)));

    // 测试结果
    Frlist_header *p_list_report = NULL;
    Frlist_node *p_st_node_report = NULL;
    Frreport_data *p_st_report_data = NULL;
    p_list_report = &((&st_hash_report)->p_list_array[0]);

    p_st_node_report = FRLIST_FIRST_NODE(p_list_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_node_report);

    p_st_report_data = (Frreport_data *) FRLIST_GET_NODE_DATA(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_report_data);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_SESSION_ID, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRSTRING);
    CU_ASSERT_STRING_EQUAL(p_st_field->field_value.p_value, TEST_RTP_SESSION_ID);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_ISRESPREQUIRED, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, FR_YES);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_START_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549154112LL);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_END_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549154112LL);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_SEND_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_DATA_BYTES, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_TRANS_TITLE, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRSTRING);
    CU_ASSERT_STRING_EQUAL(p_st_field->field_value.p_value, "PLAY sip:42010606001320082255_1@10.72.1.125");

    p_st_node_report = FRLIST_NEXT_NODE(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_node_report);

    p_st_report_data = (Frreport_data *) FRLIST_GET_NODE_DATA(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_report_data);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_START_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549354123L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_END_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549354123L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_SERVER_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 200011223L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_DOWNLOAD_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_DATA_BYTES, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 4249L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_RTP_REPORT_RESP_PACKETS_LOST, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    test_rtp_destroy_ct(&p_st_conn);
    CU_ASSERT_PTR_NULL(p_st_conn);
}

/**
 * 异常测试
 * 共2个帧，第一帧序号从119到123，丢失了序号为121的包，第二帧序号从124到131
 */
static void __case2(void)
{
    Frlist_node *p_st_node = NULL;
    Frvar_field *p_st_field = NULL;
    Conntrack *p_st_conn = NULL;
    CU_ASSERT_EQUAL(test_rtp_create_ct(&p_st_conn, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT), FR_SUCC);

    // seq 119
    char *p_bin = (char *) "8060007700008ca00000099d000001ba44000c650401028f63f8";
    char arr_payload[65536] = {'\0'};
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    unsigned int ui_payload_len = strlen(p_bin) / 2;
    Apm_packet *p_st_packet = NULL;
    struct timeval st_timestamp;
    st_timestamp.tv_sec = 1454549354L;
    st_timestamp.tv_usec = 123456L;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    Frhash_header st_hash_report;
    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 120
    p_bin = (char *) "8060007800008ca00000099d000001e0054e8c800521000319410000000161f205450af09f71ef068892fdadf7a63239857bf798ab20b3a921813a6a4d8ba324e9ac5e094693ac253408e102bafbffc4f3474cfdfc993697920b1e047955996b9304faef708f363197f7cec97a6e909c5a34518d72609aa87fd9a33447a951b242b931f8ad64e582b72d804acdb81e469ef7c8707d1e03d48ff6197ab4125e3a040755db0bff9b2fb1f6424e2d25f43eaf75076f3c3a26ea45e9fc02a3a21d034dc958d9d94d2427b109ae75d63ca2a5f4ca322fa62dc877f9784bb2eca88e480bee07a54d79ddf14ba9b961c8fe2bb872b7ecd73466ffdf378febe123c67fdae1a56cf58de459e86384bdbd74ee2b420555932df3513b5e216a3ce0408c7b0d5c261ab9d465437734c944a51653b74926f703bda631d69c051ab84d9cfab519cc695f2a3e1023d6ee9567cb390a1b65a02436afed0ccfaabddc477dffaea571309ffe826fe1445fdf9cde3fefcff7cb3b29918fde35eb182f2c206df86eac1f06035db2e07bc9e66feef92d4bcaa1573ae845eb5c4f88707236ff92c0cf44710875cbcbc77d46df44a45a6f7ccdcac6977256116df6ab222e6923bb7f91c9e1f8f4ea38dd3e01f58f1b96cd33d8fb669577c92c1143cfbc4e4aaad66a9dadbe49b10435afee8f057c9b9391d9b46c15da2b2b31c4d65e471ccf419ab0dd49c15ba7c42aed5e6578256f5bf170e0cd1e46e561a10a353867dea5c7b3ebb91416118e35eb9b08870bd7be2b31887168a1423060469f7ae581233cae7feaaad3d6239b84c34d742f3470e13075adffc26e98c4ada6a7893be1960afc5a9760d62227c79256aaf1b5846f6bb91745cb46553ee99cd3588edb79b89acceb93914d29353fd277ee5e4f2191d8f4aeb692c4ded77ad2a6bed784355bf7babfb8ebe2dc8167e6718fa2c5b7e3354ab88e48774f47d6c4a471e373862f93ef082fef13cceccfff2633ffd4eb5d2bfc523cce7635920dc6c672c5563b73af8574565f6e66be979355b8ae4a525c7bd667bcbc329e6b3975fe909ed8fc22785ef155a5f22ea35ad535e47dc6724732fea6e63408db597f08ac0905c8d05b5208b73a6c1ffc177b75cd8ebeee8f8fe534051fcab61daea66cd73655e3603acd09f1e68a6ee3cd0e20f9735988342acd19e1d9e525f6834cb68469aa682351278f4c80f5d9e5a46eff735f3782cced5770a72c936a8d2fdff78ee46e925bae655cfdd147ebd2ea2f8a5844fae03b2f537c65cf13ca30c55f64807f7ae87ff24cfb32e5565b347262e2f88782fa1b0a3afd2be3f085bbfbf76e398efe4b2ada56f37a9237fab40f22718f32ffbcf069f7e47165b4bd528a5849c71844b3a256bd2d3452a8b50b5e3b92f546b99969a445bc9cd2d2953ded3ff221a88a7e977b71ec1bb73dda3ad46249e3052cc69089b469246a538c2f79170c5ac5e2ef1545aa8f6104df2b519a4debb0c5d38236996d86e7cbbef8476b90a6ef5e4efcd1d8846b883fef22131db7b8c675770c3c605cdf5dbebcd6ce5d83493cdd1962970e26c41d4c4df4e17e672948dcc56642d001fa683ea806960e15cebe318aee59d8206d2b342f215da8b803eeeb0a9ae8325a8ab45c8e8edce2563eca9cad98e9c0315f43562b71e5e0ab4556f96fe5d2618f642ab7c92eb5939234bee7d4577835ac7225c7254430fe28bc566dd48f23bf463f1391aa3fa32999f2dee5ee3431ee234cca1644d77743f195a112b656a74934dda6922fa2da331acd74dc29f7c9011adf5af2494477badd192cb97beb4b9665817cd4071e4b6fcad1023c820976523583cf5f760ee44b274ea9144cd4c96e9e3a448c4aff6f9b8df613e23c54f1b8644faf967c3e79e3370c0ad7e317fddb81eadf0524c18209bb55fee6814080742066abdcd9cb0f";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 122
    p_bin = (char *) "8060007a00008ca00000099d000001e0054e8c800521000319412578df1c53337af0703398e69fd97ae9711a9b98c34d5437e9cfb8eefb28dd615de3974bf59a14f6eeedf516d791afefee5f4e0a57ed4ac820d5433c3a786b957ad26dfade45c84e6269c9d0c1889c50c31ce6c6ffaac36790b539f8ffb44e4eb217a372ccc67dfc0aa15ae597abc5b579f70df22574e575c53e19aa5b6aba90d1ff7c4b67583e7574ec5107975860455a21a494ecedf5e45a254111c75ac5fbc821e189e7077df7a52e5797acbe23ac0b6159b93b47b1178307d727a2fa350409f3c7a542f909dbd6309ccb464fa5732e2cfaf99e5a1e9d7af461197077d58b6438fb7dfa080c0f19dddad1e06f0f93433f75097ea466c69abdc12ee3b993dd12e2b77772d1efc20eeef6f77777d936bed0e8c1f4da4d1c18e66d36935c54f4fd53bf97d6bb490dc5f64425e8f7111ff08c2b9c7e25a4ab9cb1afd92d72a31b06f8848cd18ce86cdcc734f667e36f8dd7dbdb4b30314e5b0b99ac19b53d611d43fcc26f2ff1e9ddcec3bd9d97a3763c1984c6443c51a9b98a314672096d7e36ddf2fc1a84c445628ddc518a37799295290aaf3dfad9894d3b423f4ea60305c31631efce1c1469b0b6f6d6b08baf456d2355d2db7d5fbfcde1eade89d2e4ec6969acd63fee8251f950fcb77a688b30feffe8519c987af25d06033b48eba1ab632bdebb132fb429bf04ea5c8adbb7e4969af076171f3e0a33e2eac434d535078627c080101770fb2170f1d0b58a4769e36cdea38acf4a7b58ee88f4bc6a39e620d3817caf9f6d8c65f2ef0bf03731e915e56fde2e2fc6b4a59e98ff93b0853c79492d339ac52e435277ccaa2a955f51ee0f786b01931cc7d507c7e56461763a1548ccfdd54fc3c4937d8d86a077708ee15e551bb1fdff063e0fc325aaaf076193656278cc2baaaeb3514a1361169be5b2924401ad51d3aebc352d68b6ea322a2bc77c89facafd9421f21353a3ed27a8de13c05740ee76fcef7d5b509ea32b0546ac4d8eeb4a2535801d78809fcec13362cb83e023deadf8670f10590eae48d13ba33efe7a7466709f23f5f0017118edb675b640fb42cce6b016a2d36f6fca00023e59b0d471194db0538484bad29706aed5b0c7ae619c40eccc5c386be15f7ddef7beeb3226c12d6ab17b8dddea4330821a048a7eda262b324da6b409e8fc641b2c6cbdecb1a43924813139085d8314cdf83b82414917a392018f1c5e0ff4353c085aae53199a92bd5941d3b4b233c4d40f5bedb81c9e1f46c0eea9ffce2aa6b53eac34baa32b4d3db0ad6f70ced20e527a398a70cd0a44256daf584bc03bf248b14e6bccfd0325c9901ee97c1e02213137e9fcf2d58f426e427fbc5a876ed53133a7755345d6e5351519eb475c76e513737641356deea3d34f61e7eb122e2cae895357c2b22c2ce3ccfe584b0c4399612c1736dc961dac377bbc72e842ee30698ad4f8b777182273df1eafc9d58f0b1a9a2dc5809e0583bd2574d5134b8b1c64e5569816413beb05f18eaf130ab89d55f53a226ca6e0af33296a7887158c94401d98f9f86c9fb0181e05e62dbfefc8e1a742e5c762b66816d62c865b4761dfae58e9132708556ea62b79a45ceeafd164cc0c4c8bdf9ee876f94d6446e0b792997e2eb1afa2237d7df17275cb776a937c4560b3708ee4dfaadfaf50c3d60db71b788dc16d6337ff26e5fc4fa8cbc3d5842f1536217ebeb25f33bcf51359def1d593704358a5f177f72eab965ed609ef55bd44ee6bc1cf25c99aad57bf5aac4de4bffac8d7823bc25796bdccf482f6a5e5acf7f34f1436a4e5da37c2758a5d462be2b719cbced3757939b6a3f97bb45ff88b30ce59ef8e6ff70ee6cea88acfcc9a77adcd7862b1b59f91c33f9f08bbe17d4132eafbe398c3ba9b725e054bc9ca8906ed82e59b1f";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 123
    p_bin = (char *) "80e0007b00008ca00000099d000001e0004d8c80052100031941a849ed43fabdfa8ee578ec631fe2f195ba0ed1abb4a3f7c941e644eee731b2f34d72c9a356212f5cc9255bac13624cde7fea3d71cfda2df920ef1f16efedfb812afde55d60";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 124
    p_bin = (char *) "8060007c00009ab00000099d000001ba44000cd58401028f63f8";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 125
    p_bin = (char *) "8060007d00009ab00000099d000001e0054e8c800521000335610000000161f40d142add46501c84204a5bbe2360ddea2e24d1a21c86e706912919b65fd7adea736edd585bbc41769f36999a3034b71448263fbac2177f233c5524e5dbcd5acbad3199635b549dc5d9133536a9456a7f9b425ae75cbbab6f5ab4b89c456a7628639c4c831f4074b96a0662b55109f7873e295e3b8dfd50f0b098481817f1ceeeac902a3aa77925603bebe3f0247e1607e751e437151d91c3ccb19316aafd057adf315a8cb46efd48425f4fc25d98f9b190d6bdf094c32f78d4ba0690c5dfee04fef9167022fd6d978d57a5d1621182edfc4638de7757a38f7fc676171a39d2d7f7889c148a772f18a0d79dfe5871fde4bdb92328286f5b53299b91b57d5eaa15a6fd11e61fe8b734da61841166fccfbeca370cbc76b90b913e389c3b823d18f983326f9cabcbe22c228818cd4a6772966ac9f8fd1b087229c407761e93328a6ba11049f65d6ed79b6b5b74f5c2f443443df2dba9a7e6c734b4eae466fc2769e908c040464343a1cab49736a930ab185863db05000101d91e8b800633b0502b1adda874024141bde06da805d2c19c4656a0a3bd008c70a26f91002020f402c0d801479a85140074000450e86826c65cb4dd378029a602d68802e0aded074a6603e8326d05156607ad302a0eced1687a2a659c69eb0703780aa14e2b0059d4800dc06c82c0dbc0740f019c022a5c8ee531927195498473b5aa5a4e43fa1607c50ebe6f4235919bcdc3f2fec2103595656ad36a3516c1d59fcac796c6ce8cd4f14637b0e761245576c68e155433d0959c91efeda4891c2922faf6b228f50f4a8600eb135cc551f618ad763b9c6091f63fd402bef66384d38eb2553a743c95297633fbdcc7c2479ef6cef529b859c3bc9c8ca48b15fc54682c2a7c32b47d2f0cba49903d77f843121a11797e2236dae93587269ed4695dfd594d46aa96a68edbdefb35ec86637c9756ff766eed745db218dae620d93fa6c97112e34622d374a3d1be5846ceb8fdeb5c5c76dfa4343107d39a8fcb5631cf7c279f6202039c63468b84adeab13cd13972e8e91d725e0808c445a87c5422ee4b7a39db8d90bc9631d1a237be93c4de5d044bce6d9b31b6af882b9a18dd20a837f2412357762d5f642c118e995fb8e0a0b6147ae686f5fea0bbdf1746ca1d6b81e91b747d2cf142506118c3e89018ad7d6a716d808473ab57ffe008924062b4195a878094041909e12023637f27d59ef714000407b8342c5038c02eee0145b604231c1b6a57f9587b19c240dd45c622ba595934915478796ed64af84a7b7e64a5f4f715d09cd5735eea6fd364632401b722f9d9d3d98d11910594ccb37a237dee4aac7d450c9e9da1e4ae19c66adc4e761fc12bdcf6659b197ea32b6a05d4eb0cde81deb10cf04104ecaff4e2ddbf7298d9cef0406aab71a9a9f56affd8c86fabf04177c9356fad9dd6880157b42e85e75477a46e22b0d872f230e77a5ca84a83dfb421bfba527bddbafe1fc994dc672f350c6a38820b0ef847b21cb3b7352c351a95e2b9d09ba25a1092e40da75216bfdfc613b79cc68328ac3501c03b8e376349353f170d8d3a37d04f658875a7d092c971d1a4db01ed7bc7b44df5ee9de6b067bb7e2a933497248d9e26ea6f114952d7cc474a533e6e1a65b26fe429e282bae248d61b2989214ae7756ab72fd7c21d197b27926da207035a89aaddeff13c3ce3710c686afe5b0308ddca3f8cb30f26ffafcd602d685f3184cf7334b62909ac66bd627fbff1d7d0439c3baaff3a20a0cfbdd7f295a365a3734f1bb9b9892561a756f7244a67ffb9c852f753d95f5e49f972f4f17ca4664f44b6cadcdedaff26adb456fb8e99fa1ad164c44533fb99f5d9784a3f2a2f1b3096f89e589d263dca2f74411a19ee734f944c";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 126
    p_bin = (char *) "8060007e00009ab00000099d000001e0054e8c800521000335612ee5812e632045746f4aec21b0825f3d900e0bd3f2bd5cde0c9e5c8d8e35cd471d1f0c5e26610d8f868156fb78c6ea466e63a1b4cdfcb673309788cfe4c9245a7e2aac3146a9ea36caf5f6696ea864ad731e98fc44fb3370923d171144da12f55038ff90e910cd49c93e90da7fbb18df32c9c96de4a178c30ed9ceb99e1efb0c217c47737b21d51f5c4e42438cb77a5f21f5246f48b1bc216756d6f9657cf59b931bb1fcbdced18f5fb9489feb925629a6f8bb663936de5cf17c39ac838ec8874155bdf1779eb8c55fc4ddd55f3eb8855dbff1f1c93d32eb2b66906dc667f9a7c1c1da8ff132e4b7a4dc95f08699698e47c095e71831f6fcb84b90d65b5dd6f9ad3afc2741247da8d60affbdf7f1070f5c57b3925b47bf66634b1f371794e994eca63e26f2be4f9f12beae6dc95df29804dee7fcdcf57d9e5343cfad2e844bd9f3c64b5cbced2a45dcb9933aa6b55c49b2c86fec2cba62de6b0a1ed6adbd231c7ee40bf8aa51eedda7dfc4dd58edc3113cb5c9e1a695691640e3194bdbe63518374430dfb3b43473d32ffbb73df7beeb5aa65b929b6ff363a3059fe593afb4ac4bcfc99586dc315cd3f6f7c278cd8cf56d2fba52ed3e8b1b69db3bd04e3dab98e5b77f8eda667cb27749b7f920be8d27d6d9e2f25943ad53a7ded125179773eeb84cc6cc741e276c8dd6f5c41d9a46dd03486ff41f9a4933797bb755fc2572d1f24d656ad972f4f2b5edadcda2f3f64b9319bd9b5c246c38f7c59a0abadd75c41f0dffaa3fe65b7b9656175a1f1f8b5592c766a0da79a31413a134c72dfe6d649be6e3bab4c49cd4ae93e6e1b6e9cda25da6be12bc6b2d90eb46191d64b9f9a9d528b8ee50a3611ac1fc283eb5197c71a686f182d208febbe47c9c411a33854a54333911ce6bf2908cd49d9bf7d68e8d1861aa5ffc55a76b186b7d7cd8e9bcc47f73f776a97247e579e04e5a336b5f966bd24f5ae6d335c32f199726c4126b4cba248d458cf8a45ff246ee2af51b695d557e4968ad5ec2775b48e4f6be5e6b0e6246bdbf5f099a71e3ce98b37edfef5d9db4e563dccc1689fe26d333d68e5a99064ee5ecf5cdc773d7369a64aa6ae5e366b5784b5c39b162a8c81f7e3747cdba6d775bf928dcc30c7ee3b8a7df7592fe5d986acbdbf09e6353d95821ad5c6435bbbede9b2cc7481fc2d1a69924c1ff4999ff9b2b6d9cfdcaf8fc7ca6a7cbaa33e3797c9c9251825bee8cd59da4e6e37a437c973cac15df5c4573e209a1d8f4759384ef497630fb52272cf1dd734a6326fcb5cb8b9294d46c9cdb6915fe69a966896be20cf2d13d90daf6cec22d58ecbcdda2f6d7a9dba648517899f688d51f9cf72f2531b19d727756aeb96ef465e26127c1dac8569637c46b926dd25b1daeea9cf068fedb435cd721b4d8c77ae88625ed6e63ed17f88c61f48f6eb26122b49c5daba4d1797167daeed745e1d47ae12abd6a5977584e7cbf22be4afcd96e42897bb73e5ae8c61b1aa937e97424ece2662a38323840675796bf71ed63a68dbeeb44c7ae27aef48b7f923865dcbcbe3374fc9c77df96e91883aafcba67cdd6f8ae907b16b4cf9a7a89de3522577f1148bf355f3f2d9c7dad3f2f686593eeccbf7c9a9f15def09cc44973c8686dafe6c65e9aebbf8ba4c6dab9e8943f17486db8876a81223523bfd566f0de255544ca652747b27274d5eb977971a4f2e71016e3dc9a44edf6b63ad72f41425116848b1dc51f881092770d8ebab1b929f944b3664b9e8d8e3f5b61057247cdbecfcd5a60856a3f5a844cda61ffddb5fcf6ee3e62fcb3e55e3a37f8fe38455712f3d3690221eebd6e7d668bc77c6a2e6888b9adea2ef350d0b20c66c42d5d5a843661a9abeec20ccd5835acf964f5f8fcde018bea8f2f213725b272";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 127
    p_bin = (char *) "8060007f00009ab00000099d000001e0054e8c800521000335611cac6a96b2779fd5ea5e4e90dcb15ddea8ef6fee88a90e41df2f72d1f36a79d7eed357f34e5e591e49bee7317b572736a596f84b1318ee4f365b46d5725b39c7aaaf24cdda47e2ace7c1e3832aa562af132b8a25bc87c9b02af25ded351f7e6a694b4f173de91e18516d551ebb923baee5ceadd63a34a12456df929bdff6c6e21f66b2c56c5f3490476bcd25cba731f142302ad0d2273346934dfc4b7669f35a0d4fd3528fe6c63dfcb5e91e979a30d63a0fe5cc447502bafc41de75c8d77912ba535f84ecc6971a3057df98c4ddd3ccb762a223b2a1f335bccfdaacfa544848e7be076d32c21757c79bb6364b52b7741806ffa9da30df43cf9ce13d6343a4fe9bc67768979f931ccb92f7dd10de3abc6a97746cc94fdc60c7b0bcd9711cf66e6898c7c5d2635a58779737d9773efe4b064caaee38bf2731b195b7cc7b8659dd34b6c4f2f38aa2a468d35def26f926a3e166b89b39ff2b048d2e6cad611cff16624abdb7708362fe6f0c26f3508f3c0c6826eb0c9e93913d473d32b0e9d7921338eaed8247a9a27ab7dae38cdc6c62d416a671fb99d8e92bf22171ecdb978606bdb832bb2229e27102ded73b4b5d52f4b46eed9acec28dda4692f96f34508646a433649e6bb13c87c73aeba21078d8ae77fdd8c26f19c59e5eba69cbd73515cc77c94aefe4906289d9f92ce99987cdb4abbba0e33ea077448b1003276e98f04dc358dc0215f4fc9a896e732de2d54b7a171884bf29c83bde17df946f6c805590ac7f5dca2f92ba06bdd396b641b8e5ae4a1626dae7e38965a061bad6d931dff5c278fafa43f1fd7658718d797f84ae95f19a5fbb435edbe5bcf0aee6cb5d7e5e6a25ee6f65f26632ddf925c66934b9379f3c46a358a9a44a347c4ffe22c1ee3b9931bfe6b7969e229c97d235f972635f84edb6d1e2490dcc6b7c86d33655612f19de6812589eee3c73df243da6af45e3b3a33864c079815b11dd3b5eeaac8875e927dc1dcd67d9a34b3e4e4ebded96ac376962a6e0f6c1b9cb109d974f50858c9b719c6de9f725b1f6de20f4ae46187483a4e10f8e9706fc8457685a7226afe8fd8d57f9281a31d6e791f2d1a325f7784369d225a86a33e6e45b7f2533d103fa228e35b2eb1c8c6837e46255558562f166b5097dc54daf8bf03935e5bb9914355ff34a626d4718cec4da3537c588c0dcf8a97ec7bc66b8444a31d32097ed869ab6fc6993e9e1fd71aaf52089c413d199b8af0e2d4550c72cfdc23365521ee4296578f10de1d31eff4e0569d2de83c1a2423d3b2dd28db2e090efb09e0f52fac1a86c422f9fb35f97871e42f6fa52cd8eb7db8962048bbc033d2c3c5b0e27fb473d55897f3096704c66cad7e4d8dca4122f2d276687e4e6a9ab5789c3b5346e4d616f9633ee25bdc44e41248bb48ed4b67e59c82e80d2eab929ad3f2db5493ae82593a597504ad55d98d8de9486f67989b72f8895866bad51d8d59a2938a873bbc4e15727e5535cc669b2bee63077fc0dbbf9b3e3fe26d1b749051cfee63a74c6dbf72ee1bfb13040d6a17a3166e81be6c5a5fd6d14c54867697b38eb443868e908c508c70ecd18630c8677705224de95ca6cee2824f7e2d4a643236395b7c06a998268d5ccd2dbd1f5b989dbcb6c22156ae4afdf278de1830eb4ac8fd7ca1f533b3a31af50e238e8af9663b2077e97be33437103a6b5a362476980ef712792a49465a8e059e8e6097bbcfbf71f43f0ab9f586c7c155c4d4b5cbcb5d2aa046a7b01fdb1a88fd8dd088080fb0e5cadc3afed027bedef7b0d41f4841ab3aa48a777e06ae242adb08898c66f4ecccc116df5055b9a6c3a9cb9abc4b57cd4796adebe3952f8d55fb61bdc4d38129ead557ba95dbfd6a33acf07d32342f558a406e517cae167496af7";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 128
    p_bin = (char *) "8060008000009ab00000099d000001e0054e8c800521000335615aba681218c62c065a02ce9d38270a0b8f564cd374c1dff8bbe53643be103c1dcc4b95925ed156bc14bd7722a765bea229d962afef660c2fb70d0811d88ad8fe0a29d33c6a9fcfb1dc94c3ff5e14261ee6828af64ab228de5ad50b2d81a79adac50a117d0b83be07b3f0aec3f7e1c9d30f0a1f3d1a1df1203f4b850ec94bed7f97fbe6a8d5547eba5d72c6035a90261dd4a407b773b17775208e3ac29c733ec4de0a7b9c71411f48ef8bb8128704714038838fd0a2e4a5ba98ed51139d24cbd4d53812479682d549eee05a5d8b131bc3617ad5d8c9243b88ceb1fe4da3feeb35b2deae2293066953491b64aae2b2b4ef76b1bffbfdc637fb7b34f97be4968d3df3598e8d03d29f94d5a0a3df7cc7c3ab598e4637af35ccca2d4b1e64cfbb60a856d0cac87d529ac6478e072c5621de9ffb1ec6aa81df96d0b18c2aeb679f4d6392b84d1d3dbc39b01c7a69f7c3f0e31af56fd051068c13d05a6f6d1ac0c7b5903ac265f944e5c2e7bc972880de310ab4f3c22747d0a39098b4852632bc2c3e4d87057292a318c4b1968d46db83f2561069333c947a32120f9b56dab6c8b1cd57dafe119e88865b0377885a3e9cb05cc5152d6e48c8fbb966a1d34179c307e9f7debfa8c348e4e32d4b0a2a5b660acf3c76deb376248d5fa3504889f57da8f1028407a79adae04cf49f5520a75e18e4e123ed889642f5e619fa5bcbc190809c25f051df663b170e656157c2b6f4c4989588920ad52ed08dcc53337efcc5b6dcb1a30ea84351ee54d2359726e1ff86920d783ee781182d80245b0af9a87d79166a0397573629857a648aa9ab0ef18147ae615349048c136536dac53a7749f078419695a469e771acce8792f356105e498256e20b505dee5c8dbca7c01ffeb3b8356fa863d710c85bbadc3ff1c84c91a7a17271170d4aa147000bb93a6e6cc4688b0b649cdc9a54356c4e01d5a92fd30c3aedba9aa71df2f65aae339e035998eac111c5739f6b32fc2d40c7a93c92ac4479bbb0d88ecaba4b7cb08ca412d3369fecd29f19e3c5eb054237645adca5e077bd5404b0884983be0c967f19f2df242c98f10103c36ccbacf5f909fa4569946e85ff2d6215077382cb58729532f2099ed373155b96d3f76a6b67833eb6ebbe6d6caafdd590c872cce73cd606377388e63b693c5f2190d0744bbf77fee9e24bc4b2616d5f12c65139a5c74cea09c74d30e131ad376b18c8c9bfd78b8141fb9c48be43cff493eeea9882ae9406c19ac88249c6990f8d5deb2b147323cd32c2019e1ccd7dde1b3848c9d64f9415e279b522ff11fb6b5864e22701822c81d9fefc77c511b6e584881538420a89ce89ef5fac8edbb2a7b980aafea5bd47bdd08cddcaababcfc96777ded68545b1be072fd8605646b748553296f9aed15860879fe868a9ab0e874b1cc573b07c52555ee933f4ce3e419baf19d05bf8a8a54b08b61e2b2fa6a9cf5d226ab3c78301827bb7e2445eef6f0642855e6b3541830c485f104e1c103ec225d244d38ed4f777aa0422474cc1be4c3998cc453b4efe3e3f16d1e59bee4aae9da689b9cdc80a23ae0e9cf41d8460e9891e4dac37f9841da75ed39a08104c4c7b0a30e86a9d3b08971169a66a78228f593bcf20869a7d098d8bd4565c55a894ac208cc14666f3f29da3be8cb7ee239e84a9e0afa56bbc7aefd7e59a5aaef86189f5d7c561856718cd94e4eccc63f8d9bb3be5a0de12371aa9559d2af5265918d5709f9ba91ab5af2d4cffdc5b44fe3b4eb697eb2721c8ce6ebba756fdccc57e5a3766d279510473c8ff93a238c5dfe5469ac1d5767e5f05b7d59914f9a6fd0a6a465176d55642e337b4b4898aa88f9bfcb63b62ed2eecc211ba2ff66aa6b8349a88d41ea740be0fe2779bc4fccc5058805608";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 129
    p_bin = (char *) "8060008100009ab00000099d000001e0054e8c8005210003356172b72d33529a684cfd247259245c55bc610b2fbf02f0482321ca493db6878dc9167959994b8622147d386cc7dbef240b2356f718dc45d5e0d310314df92a5518aff84da72e58cf54712e2a8d37691b41a64df363f2d054cbc572e17099b51dbbd4477b23fd6c863cef2a5fa8896d19fe8c1fdf5f559794f9392848301c284277772584c62bb7e8d29aa8949d2247da285569d5cd8ec24b3cd0bba43cf95e6e2a68ece55309a235268110703838b325e6a61c0c7219e9b65cc48ce14fded627e9d588d9b4b1ac473198fff191e3ad0cc9b71ec398b4d4c5dd46296aafc75d4e97f9303241f54ef94d67375c51e7e965cd49c4d8c9e997c69fcb6919ef2772e5385b90c1dae6a5338f4a0c07343daae851af4adcdad3bbbbd5beabdafabf464442668366a493e5fc510b698436df41d6ba122578a4496c57d6e5a58c959a944b352d3e535eeddc9965637ae5350f3ff173d835e575b68ff02c82b2ea3feabcde39e272f2b0a2b65da2fc9cb2e27f973d9e7877513b91240c076aab688494421e7f9138feff5dedcbd0b625e9c34229ad75dae26da073e0d4a6cff5ebb11a8af5bee23cdffed608c1290d5037ed18bc1077baf2b2e339384e4c4c863abc98457fdeccc8a4f59b9a6736c370ff75bb9b92f77859cfd221adb6adfd2effd6f6ba3ee639cc21a8f473639a5a2be248e289d934e3bb5213d7aa8b9bb060d765b9b9888e35b5152df0cb7d165253121c6f571109dee61fdfd2077a5815c3248fe5a7cded9c9318b7e5123d5747ebe5b6cc6fdab8a96e5313b59addb3a972cbd1b4edd737356acd725d2a4b979a8be5e0ed8d193abee4fe6e7c6d5e17d4fca64dd37f1d77777bbddde6c7bc80fbad9cdbd2ee07fae04679852f78466a561b81c45da920e5a21b52e5da51810e2a8d557314a0edd5db71f0a84444e78e91a516e5cf98b6f2fd3289dcbc98cf5b6d796411c399a3bc6f9539c93c9434d35562ed1eea7b3dc27de89c41827b297a920fcdf0c7c320cf4c0ddf01dd51dc38dc63ea602c79e04e9fd258d1280eca6a9d69d39849f2d1b352cc246a75b112c3736a27ce845e6e1f7fd5e5ef30fa71f965ddfdca63a4df92ab6cdb97242fcda6865917929a77f1173b0eed3b0f1fc2466e2647b6b2fc1984c44b621a3596cf876c2c1a84c423e5e5c3ecd62f34a3c0f5223dd644fd55a4cd70030758cf37bfd870532665b79f65c8dfe24e9372d159c7690c6eb106f95e5a1496c9b45f5b2ebf909a44314408b8ddc84f464bc9d09792cd1cbf16f541811adf3617f13fa6240bd2c717883afab357def7f34d74da7cda6ed79233eef5924d46ea92776dd552ee239b53e7e2725bf362757931d3195c924a5acba9793b9702cd73536a771392865512e2e138c265bd91cbd0d34fc418ec3ed97fe5a72f7f253341cd3e0e42af56aa8cebaad44e7a50c45b2e52298970007382b3ae5c76359ad753c0bed6c59470a16272a4fd5b339aae225a4d8c7be5f7ae2b53082b871ca4efcf97b2f22e5ec4be8caabd56bfd882e5302bec028b99cf0f77d0aa6fcb691f25b246d653bca24929afe264acfee7a24d61f2d99a2cec5f2da365bf2d3cd4f172f4d34f1167e6962eb11cd4d534fcbbaa25cb6b35f97465a5418e4be66cfb93620ca9c9055afe4999dc8a7a81082427c067a9294b1a954cc2b8ad6b31a5098fcaf8db4ed938f69805352a38b57bc352d68b6ed10207a4332be08cce831ba7440b19a9e5108686bc65bef645ead041d34cbfc4082897ba7893f0a1855397de5866f130c7fbdb3106b2f631c83069ed6af89b796944434ff96c721a24b58be6a4af5c9a32c2313c865cac7b3da939f50868d352d4afbabc6c044030186fe128e26192799e2ec61bc9e6b812c10e6ead507d1110135a18";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 130
    p_bin = (char *) "8060008200009ab00000099d000001e0054e8c8005210003356101d78813f9d9192774f958eb5b80dcf105b1ea94749dd1e3edfe4b88fef6f69072136f72cc2e133a30150d916b8fbe4c0032cbdb80f739af65867be15dc28fd690b93c0aa0d448951755537af924c6361b5e5b4b2c92ddd2a0e3115f35a363d4b9b1ba32dea47d92912d2c2aeb92f1bc2769d3bcf92735a35315aaddec82317f02684c66f1a04de174da2cef4719e16f2282e6e373881cec79759806b74211a3d5f5e048040337b48bcfc5c40702855047b9a107979a540758871a1555dcc8261355485c4775b1040c587ff0abf8c65e89caf3b6e2f4c86d7fac0d1217f264b5dde0d84fe45038e85dd9345557acd2b7bdbdd22e42ee4b74764512e58536c3e5e1c47d0444bb71ba3370a0ce9c7bcfe0f43ac862d10403e955ad8211aff324d333ff2372db36b1e692aa82eeeea9556f96ccc94d0a3f7638fc581788935b4e6625ff268c66ac4b7ef96f35199794cb2db9dffbdeb13a88e63e3961ed35639f308119cf9665b15ed5809a060c20e6d473d659bc0aa0847eebd74446644be7a4563cfefc0aa08f30afaabd94c112e7ae1c118bf3ea9770144d8e8d93d8101c2f23cbffaf90b25188878ae66821b581894ecef5cf319bac35dd4c55379af971ce6892dc80c5a5efcfb43bbf94d76de38e448abac7c84c763215063111e2eed21b341323fd2f93b97b45ff9b3f2fdebabb3494ffbae26d4de954820f968a91689745d36ddbecb1af41f7cb3239e691d75372cf94a10ee2f6c7f05e5936ff24f7aae68cfb8beeadb3398f9bb89602f7e5f620c30be9564cb9317554f2a533143b9a7a49398f2be6a79aca99b09cb185ff97c7d4ed72d51aa89e69582418166a9ac0da330ab0b9a7cb5f265a0bd208715966ca236f484a4baee8c7ffa6bbdb76c952522666d56eb963da7c8fbf90cb56bd9f1bed3ee2f5f725bfe5968a81faf965c634be4a526fdf1d41823e5ba6529be58de51358d77bab7e6b574c62ff45a8affbe5932a87e5ab64f36c3562b5517aaadf52778cb4bd4eb11cd1dee1a3096e37b371bc1794f648c6623cd96ee96d5eef965b967f2c773ae6b92318ff934a7d572c8ccb4b995774a6f6bfe27527f35a77e4e2fb9708d5569ad4945fe26cfa6b55331c812aaaad4d8ce9dd7cdb6e90be4d836865abe12b958cadd56a3f974cf48611e6a6955dc559e7ece90ccefacbdcee3bf7cd971f5addfd64d7cd465ca4b93689f22ff92b55f132310735a6aab1dcb29168ac3ad72d5daf9ace4c48572523e616b925639e9eeb86773d7cd6d5a4c97be5b632d1af788a73ec865aad7df31ec21dfbf9abf2decc9af88c94b6f69aaafb9ad4fb7cdb1a99be27274b93d31697863966d439ff9a98d0c6db4405f797be4e4928db091e9faaee93334a046d12a374ebbea59a55d5754f4fbf92e3faf7dd1aba3f7a9690fdd65bbee95afc968f9a92f39246e60bcd576db11cd93d35c96dda8634e8669a73e26ccff6117dc472d4ec9b35dcf4a5752482024396fdcf88eb96a6b4cda6895b4b55cdba6d796d0fb5d47efb96c9cdcd868d694577b725be6f1ccd72654a4fae6a72ea0615dfdd8c96cff7cf46c9cb15ec2d7e2d691320ed7f8427c4b196fdf652383eb1adf95e19e39eae25e5db3ca0d72cfd5175f965223c6a539f924ba77dd147a57ddf13077cd165e7365d495ae4b6f6babb966658deb97b44eb8479fb2486d5277e25f5cd6e7f4f70978ed8351b9a2977050bbf95329b19d2b8863b512feaf94b0854c7d6d9fb4c9ee9a2f232c1d3fbd4df272496825abc9c91e8d61bef8ab9a9554a6b2adb3567944734d84776bd734db4699392ad9bdf52b5fe4908366be5b9482f00c23c27249e9377717abe6bd549dd72d0dcd9edadbfebf094f8c754396052efbd90fd989f35f198ff34eea6a2";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 131
    p_bin = (char *) "80e0008300009ab00000099d000001e0019c8c80052100033561b9ad2689fb35b9acf423dada6b5c9a1a66cf2ef1fa0ceee5a4d417b374cb419cb197d71cf7aadde6e6c9952776923e6fbbcf1f88e3631be435a43ed566ddcb9ef249938e2d7abbc4f3546e2168c21c9cc949126e5e2e19729b3e6aee74f9ba67e25ff5dbfdfe2ab21048666f435b1721b6c96c20a2415b979a544b4fc448e977666d889cb34da572336a2b9aaf331e5cc44b7432725e927e48c77df768f895938b8cc6c3a36db7b896fcfdd29b3e2b6e3fd742557e4b397c57172e524cd54e2d3f5df4cbcf7e9d35eb9291eec2f77bb3272de48572e43196df24c628cd9be5a19208ebefd1a5d4367f7a063431c64e58dfbef8ad37725b313df74de4c7c251d5e8f8eac6ea5bddc24b58fa971ec74fb27276c772acba58f9a68c770c23e58fcab88844abb95afebdfcb63b47ef919fa9dd0cbcb6359ba52d7cb6aeebbd97d177f2748b85eec76cf52f35a43764b9b451e902cdf25d6ab92d15c667f2dd378d5c708a3c7346530d54fc89aa503ff19a97919a9a6fbc73dc9c92c104f53e6e4e5a18482fc9968d62f9286ef0af3648a0a5f74b2e92";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    p_st_conn->flg_has_master = FR_YES;
    p_st_conn->st_masterInfo.exp_src_ip = iptools_parse_ipaddr(TEST_RTP_SRC_IP);
    p_st_conn->st_masterInfo.exp_src_port = TEST_RTP_SRC_PORT;
    p_st_conn->st_masterInfo.exp_dst_ip = iptools_parse_ipaddr(TEST_RTP_DST_IP);
    p_st_conn->st_masterInfo.exp_dst_port = TEST_RTP_DST_PORT;

    unsigned long ul_invite_begin_timestamp;
    struct timeval st_timestamp_first;
    st_timestamp_first.tv_sec = 1454549154L;
    st_timestamp_first.tv_usec = 112233L;
    ul_invite_begin_timestamp = rtp_get_timestamp(&st_timestamp_first);
    char arr_invite_time[32] = {'\0'};
    snprintf(arr_invite_time, sizeof(arr_invite_time), "%lu", ul_invite_begin_timestamp);
    p_st_conn->st_masterInfo.p_lst_hdr_param = frlist_create();
    p_st_field = frvarfield_str(APM_SIP_INVITE_BEGIN_TIME, arr_invite_time);
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    p_st_field = frvarfield_str(APM_SIP_INVITE_PLAY_URI, "sip:42010606001320082255_1@10.72.1.125");
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    CU_ASSERT_TRUE(APM_L7_ANALYZE_IS_SUCC(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report)));

    // 测试结果
    Frlist_header *p_list_report = NULL;
    Frlist_node *p_st_node_report = NULL;
    Frreport_data *p_st_report_data = NULL;
    p_list_report = &((&st_hash_report)->p_list_array[0]);

    p_st_node_report = FRLIST_FIRST_NODE(p_list_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_node_report);

    p_st_report_data = (Frreport_data *) FRLIST_GET_NODE_DATA(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_report_data);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_SESSION_ID, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRSTRING);
    CU_ASSERT_STRING_EQUAL(p_st_field->field_value.p_value, TEST_RTP_SESSION_ID);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_ISRESPREQUIRED, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, FR_YES);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_START_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549154112LL);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_END_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549154112LL);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_SEND_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_DATA_BYTES, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_TRANS_TITLE, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRSTRING);
    CU_ASSERT_STRING_EQUAL(p_st_field->field_value.p_value, "PLAY sip:42010606001320082255_1@10.72.1.125");

    p_st_node_report = FRLIST_NEXT_NODE(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_node_report);

    p_st_report_data = (Frreport_data *) FRLIST_GET_NODE_DATA(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_report_data);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_START_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549354123L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_END_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549354123L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_SERVER_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 200011223L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_DOWNLOAD_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_DATA_BYTES, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 8712L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_RTP_REPORT_RESP_PACKETS_LOST, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1L);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    test_rtp_destroy_ct(&p_st_conn);
    CU_ASSERT_PTR_NULL(p_st_conn);
}

/**
 * 异常测试
 * 共2个帧，第一帧序号从119到123，丢失了序号为120,121的包，第二帧序号从124到131
 */
static void __case3(void)
{
    Frlist_node *p_st_node = NULL;
    Frvar_field *p_st_field = NULL;
    Conntrack *p_st_conn = NULL;
    CU_ASSERT_EQUAL(test_rtp_create_ct(&p_st_conn, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT), FR_SUCC);

    // seq 119
    char *p_bin = (char *) "8060007700008ca00000099d000001ba44000c650401028f63f8";
    char arr_payload[65536] = {'\0'};
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    unsigned int ui_payload_len = strlen(p_bin) / 2;
    Apm_packet *p_st_packet = NULL;
    struct timeval st_timestamp;
    st_timestamp.tv_sec = 1454549354L;
    st_timestamp.tv_usec = 123456L;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    Frhash_header st_hash_report;
    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 122
    p_bin = (char *) "8060007a00008ca00000099d000001e0054e8c800521000319412578df1c53337af0703398e69fd97ae9711a9b98c34d5437e9cfb8eefb28dd615de3974bf59a14f6eeedf516d791afefee5f4e0a57ed4ac820d5433c3a786b957ad26dfade45c84e6269c9d0c1889c50c31ce6c6ffaac36790b539f8ffb44e4eb217a372ccc67dfc0aa15ae597abc5b579f70df22574e575c53e19aa5b6aba90d1ff7c4b67583e7574ec5107975860455a21a494ecedf5e45a254111c75ac5fbc821e189e7077df7a52e5797acbe23ac0b6159b93b47b1178307d727a2fa350409f3c7a542f909dbd6309ccb464fa5732e2cfaf99e5a1e9d7af461197077d58b6438fb7dfa080c0f19dddad1e06f0f93433f75097ea466c69abdc12ee3b993dd12e2b77772d1efc20eeef6f77777d936bed0e8c1f4da4d1c18e66d36935c54f4fd53bf97d6bb490dc5f64425e8f7111ff08c2b9c7e25a4ab9cb1afd92d72a31b06f8848cd18ce86cdcc734f667e36f8dd7dbdb4b30314e5b0b99ac19b53d611d43fcc26f2ff1e9ddcec3bd9d97a3763c1984c6443c51a9b98a314672096d7e36ddf2fc1a84c445628ddc518a37799295290aaf3dfad9894d3b423f4ea60305c31631efce1c1469b0b6f6d6b08baf456d2355d2db7d5fbfcde1eade89d2e4ec6969acd63fee8251f950fcb77a688b30feffe8519c987af25d06033b48eba1ab632bdebb132fb429bf04ea5c8adbb7e4969af076171f3e0a33e2eac434d535078627c080101770fb2170f1d0b58a4769e36cdea38acf4a7b58ee88f4bc6a39e620d3817caf9f6d8c65f2ef0bf03731e915e56fde2e2fc6b4a59e98ff93b0853c79492d339ac52e435277ccaa2a955f51ee0f786b01931cc7d507c7e56461763a1548ccfdd54fc3c4937d8d86a077708ee15e551bb1fdff063e0fc325aaaf076193656278cc2baaaeb3514a1361169be5b2924401ad51d3aebc352d68b6ea322a2bc77c89facafd9421f21353a3ed27a8de13c05740ee76fcef7d5b509ea32b0546ac4d8eeb4a2535801d78809fcec13362cb83e023deadf8670f10590eae48d13ba33efe7a7466709f23f5f0017118edb675b640fb42cce6b016a2d36f6fca00023e59b0d471194db0538484bad29706aed5b0c7ae619c40eccc5c386be15f7ddef7beeb3226c12d6ab17b8dddea4330821a048a7eda262b324da6b409e8fc641b2c6cbdecb1a43924813139085d8314cdf83b82414917a392018f1c5e0ff4353c085aae53199a92bd5941d3b4b233c4d40f5bedb81c9e1f46c0eea9ffce2aa6b53eac34baa32b4d3db0ad6f70ced20e527a398a70cd0a44256daf584bc03bf248b14e6bccfd0325c9901ee97c1e02213137e9fcf2d58f426e427fbc5a876ed53133a7755345d6e5351519eb475c76e513737641356deea3d34f61e7eb122e2cae895357c2b22c2ce3ccfe584b0c4399612c1736dc961dac377bbc72e842ee30698ad4f8b777182273df1eafc9d58f0b1a9a2dc5809e0583bd2574d5134b8b1c64e5569816413beb05f18eaf130ab89d55f53a226ca6e0af33296a7887158c94401d98f9f86c9fb0181e05e62dbfefc8e1a742e5c762b66816d62c865b4761dfae58e9132708556ea62b79a45ceeafd164cc0c4c8bdf9ee876f94d6446e0b792997e2eb1afa2237d7df17275cb776a937c4560b3708ee4dfaadfaf50c3d60db71b788dc16d6337ff26e5fc4fa8cbc3d5842f1536217ebeb25f33bcf51359def1d593704358a5f177f72eab965ed609ef55bd44ee6bc1cf25c99aad57bf5aac4de4bffac8d7823bc25796bdccf482f6a5e5acf7f34f1436a4e5da37c2758a5d462be2b719cbced3757939b6a3f97bb45ff88b30ce59ef8e6ff70ee6cea88acfcc9a77adcd7862b1b59f91c33f9f08bbe17d4132eafbe398c3ba9b725e054bc9ca8906ed82e59b1f";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 123
    p_bin = (char *) "80e0007b00008ca00000099d000001e0004d8c80052100031941a849ed43fabdfa8ee578ec631fe2f195ba0ed1abb4a3f7c941e644eee731b2f34d72c9a356212f5cc9255bac13624cde7fea3d71cfda2df920ef1f16efedfb812afde55d60";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 124
    p_bin = (char *) "8060007c00009ab00000099d000001ba44000cd58401028f63f8";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 125
    p_bin = (char *) "8060007d00009ab00000099d000001e0054e8c800521000335610000000161f40d142add46501c84204a5bbe2360ddea2e24d1a21c86e706912919b65fd7adea736edd585bbc41769f36999a3034b71448263fbac2177f233c5524e5dbcd5acbad3199635b549dc5d9133536a9456a7f9b425ae75cbbab6f5ab4b89c456a7628639c4c831f4074b96a0662b55109f7873e295e3b8dfd50f0b098481817f1ceeeac902a3aa77925603bebe3f0247e1607e751e437151d91c3ccb19316aafd057adf315a8cb46efd48425f4fc25d98f9b190d6bdf094c32f78d4ba0690c5dfee04fef9167022fd6d978d57a5d1621182edfc4638de7757a38f7fc676171a39d2d7f7889c148a772f18a0d79dfe5871fde4bdb92328286f5b53299b91b57d5eaa15a6fd11e61fe8b734da61841166fccfbeca370cbc76b90b913e389c3b823d18f983326f9cabcbe22c228818cd4a6772966ac9f8fd1b087229c407761e93328a6ba11049f65d6ed79b6b5b74f5c2f443443df2dba9a7e6c734b4eae466fc2769e908c040464343a1cab49736a930ab185863db05000101d91e8b800633b0502b1adda874024141bde06da805d2c19c4656a0a3bd008c70a26f91002020f402c0d801479a85140074000450e86826c65cb4dd378029a602d68802e0aded074a6603e8326d05156607ad302a0eced1687a2a659c69eb0703780aa14e2b0059d4800dc06c82c0dbc0740f019c022a5c8ee531927195498473b5aa5a4e43fa1607c50ebe6f4235919bcdc3f2fec2103595656ad36a3516c1d59fcac796c6ce8cd4f14637b0e761245576c68e155433d0959c91efeda4891c2922faf6b228f50f4a8600eb135cc551f618ad763b9c6091f63fd402bef66384d38eb2553a743c95297633fbdcc7c2479ef6cef529b859c3bc9c8ca48b15fc54682c2a7c32b47d2f0cba49903d77f843121a11797e2236dae93587269ed4695dfd594d46aa96a68edbdefb35ec86637c9756ff766eed745db218dae620d93fa6c97112e34622d374a3d1be5846ceb8fdeb5c5c76dfa4343107d39a8fcb5631cf7c279f6202039c63468b84adeab13cd13972e8e91d725e0808c445a87c5422ee4b7a39db8d90bc9631d1a237be93c4de5d044bce6d9b31b6af882b9a18dd20a837f2412357762d5f642c118e995fb8e0a0b6147ae686f5fea0bbdf1746ca1d6b81e91b747d2cf142506118c3e89018ad7d6a716d808473ab57ffe008924062b4195a878094041909e12023637f27d59ef714000407b8342c5038c02eee0145b604231c1b6a57f9587b19c240dd45c622ba595934915478796ed64af84a7b7e64a5f4f715d09cd5735eea6fd364632401b722f9d9d3d98d11910594ccb37a237dee4aac7d450c9e9da1e4ae19c66adc4e761fc12bdcf6659b197ea32b6a05d4eb0cde81deb10cf04104ecaff4e2ddbf7298d9cef0406aab71a9a9f56affd8c86fabf04177c9356fad9dd6880157b42e85e75477a46e22b0d872f230e77a5ca84a83dfb421bfba527bddbafe1fc994dc672f350c6a38820b0ef847b21cb3b7352c351a95e2b9d09ba25a1092e40da75216bfdfc613b79cc68328ac3501c03b8e376349353f170d8d3a37d04f658875a7d092c971d1a4db01ed7bc7b44df5ee9de6b067bb7e2a933497248d9e26ea6f114952d7cc474a533e6e1a65b26fe429e282bae248d61b2989214ae7756ab72fd7c21d197b27926da207035a89aaddeff13c3ce3710c686afe5b0308ddca3f8cb30f26ffafcd602d685f3184cf7334b62909ac66bd627fbff1d7d0439c3baaff3a20a0cfbdd7f295a365a3734f1bb9b9892561a756f7244a67ffb9c852f753d95f5e49f972f4f17ca4664f44b6cadcdedaff26adb456fb8e99fa1ad164c44533fb99f5d9784a3f2a2f1b3096f89e589d263dca2f74411a19ee734f944c";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 126
    p_bin = (char *) "8060007e00009ab00000099d000001e0054e8c800521000335612ee5812e632045746f4aec21b0825f3d900e0bd3f2bd5cde0c9e5c8d8e35cd471d1f0c5e26610d8f868156fb78c6ea466e63a1b4cdfcb673309788cfe4c9245a7e2aac3146a9ea36caf5f6696ea864ad731e98fc44fb3370923d171144da12f55038ff90e910cd49c93e90da7fbb18df32c9c96de4a178c30ed9ceb99e1efb0c217c47737b21d51f5c4e42438cb77a5f21f5246f48b1bc216756d6f9657cf59b931bb1fcbdced18f5fb9489feb925629a6f8bb663936de5cf17c39ac838ec8874155bdf1779eb8c55fc4ddd55f3eb8855dbff1f1c93d32eb2b66906dc667f9a7c1c1da8ff132e4b7a4dc95f08699698e47c095e71831f6fcb84b90d65b5dd6f9ad3afc2741247da8d60affbdf7f1070f5c57b3925b47bf66634b1f371794e994eca63e26f2be4f9f12beae6dc95df29804dee7fcdcf57d9e5343cfad2e844bd9f3c64b5cbced2a45dcb9933aa6b55c49b2c86fec2cba62de6b0a1ed6adbd231c7ee40bf8aa51eedda7dfc4dd58edc3113cb5c9e1a695691640e3194bdbe63518374430dfb3b43473d32ffbb73df7beeb5aa65b929b6ff363a3059fe593afb4ac4bcfc99586dc315cd3f6f7c278cd8cf56d2fba52ed3e8b1b69db3bd04e3dab98e5b77f8eda667cb27749b7f920be8d27d6d9e2f25943ad53a7ded125179773eeb84cc6cc741e276c8dd6f5c41d9a46dd03486ff41f9a4933797bb755fc2572d1f24d656ad972f4f2b5edadcda2f3f64b9319bd9b5c246c38f7c59a0abadd75c41f0dffaa3fe65b7b9656175a1f1f8b5592c766a0da79a31413a134c72dfe6d649be6e3bab4c49cd4ae93e6e1b6e9cda25da6be12bc6b2d90eb46191d64b9f9a9d528b8ee50a3611ac1fc283eb5197c71a686f182d208febbe47c9c411a33854a54333911ce6bf2908cd49d9bf7d68e8d1861aa5ffc55a76b186b7d7cd8e9bcc47f73f776a97247e579e04e5a336b5f966bd24f5ae6d335c32f199726c4126b4cba248d458cf8a45ff246ee2af51b695d557e4968ad5ec2775b48e4f6be5e6b0e6246bdbf5f099a71e3ce98b37edfef5d9db4e563dccc1689fe26d333d68e5a99064ee5ecf5cdc773d7369a64aa6ae5e366b5784b5c39b162a8c81f7e3747cdba6d775bf928dcc30c7ee3b8a7df7592fe5d986acbdbf09e6353d95821ad5c6435bbbede9b2cc7481fc2d1a69924c1ff4999ff9b2b6d9cfdcaf8fc7ca6a7cbaa33e3797c9c9251825bee8cd59da4e6e37a437c973cac15df5c4573e209a1d8f4759384ef497630fb52272cf1dd734a6326fcb5cb8b9294d46c9cdb6915fe69a966896be20cf2d13d90daf6cec22d58ecbcdda2f6d7a9dba648517899f688d51f9cf72f2531b19d727756aeb96ef465e26127c1dac8569637c46b926dd25b1daeea9cf068fedb435cd721b4d8c77ae88625ed6e63ed17f88c61f48f6eb26122b49c5daba4d1797167daeed745e1d47ae12abd6a5977584e7cbf22be4afcd96e42897bb73e5ae8c61b1aa937e97424ece2662a38323840675796bf71ed63a68dbeeb44c7ae27aef48b7f923865dcbcbe3374fc9c77df96e91883aafcba67cdd6f8ae907b16b4cf9a7a89de3522577f1148bf355f3f2d9c7dad3f2f686593eeccbf7c9a9f15def09cc44973c8686dafe6c65e9aebbf8ba4c6dab9e8943f17486db8876a81223523bfd566f0de255544ca652747b27274d5eb977971a4f2e71016e3dc9a44edf6b63ad72f41425116848b1dc51f881092770d8ebab1b929f944b3664b9e8d8e3f5b61057247cdbecfcd5a60856a3f5a844cda61ffddb5fcf6ee3e62fcb3e55e3a37f8fe38455712f3d3690221eebd6e7d668bc77c6a2e6888b9adea2ef350d0b20c66c42d5d5a843661a9abeec20ccd5835acf964f5f8fcde018bea8f2f213725b272";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 127
    p_bin = (char *) "8060007f00009ab00000099d000001e0054e8c800521000335611cac6a96b2779fd5ea5e4e90dcb15ddea8ef6fee88a90e41df2f72d1f36a79d7eed357f34e5e591e49bee7317b572736a596f84b1318ee4f365b46d5725b39c7aaaf24cdda47e2ace7c1e3832aa562af132b8a25bc87c9b02af25ded351f7e6a694b4f173de91e18516d551ebb923baee5ceadd63a34a12456df929bdff6c6e21f66b2c56c5f3490476bcd25cba731f142302ad0d2273346934dfc4b7669f35a0d4fd3528fe6c63dfcb5e91e979a30d63a0fe5cc447502bafc41de75c8d77912ba535f84ecc6971a3057df98c4ddd3ccb762a223b2a1f335bccfdaacfa544848e7be076d32c21757c79bb6364b52b7741806ffa9da30df43cf9ce13d6343a4fe9bc67768979f931ccb92f7dd10de3abc6a97746cc94fdc60c7b0bcd9711cf66e6898c7c5d2635a58779737d9773efe4b064caaee38bf2731b195b7cc7b8659dd34b6c4f2f38aa2a468d35def26f926a3e166b89b39ff2b048d2e6cad611cff16624abdb7708362fe6f0c26f3508f3c0c6826eb0c9e93913d473d32b0e9d7921338eaed8247a9a27ab7dae38cdc6c62d416a671fb99d8e92bf22171ecdb978606bdb832bb2229e27102ded73b4b5d52f4b46eed9acec28dda4692f96f34508646a433649e6bb13c87c73aeba21078d8ae77fdd8c26f19c59e5eba69cbd73515cc77c94aefe4906289d9f92ce99987cdb4abbba0e33ea077448b1003276e98f04dc358dc0215f4fc9a896e732de2d54b7a171884bf29c83bde17df946f6c805590ac7f5dca2f92ba06bdd396b641b8e5ae4a1626dae7e38965a061bad6d931dff5c278fafa43f1fd7658718d797f84ae95f19a5fbb435edbe5bcf0aee6cb5d7e5e6a25ee6f65f26632ddf925c66934b9379f3c46a358a9a44a347c4ffe22c1ee3b9931bfe6b7969e229c97d235f972635f84edb6d1e2490dcc6b7c86d33655612f19de6812589eee3c73df243da6af45e3b3a33864c079815b11dd3b5eeaac8875e927dc1dcd67d9a34b3e4e4ebded96ac376962a6e0f6c1b9cb109d974f50858c9b719c6de9f725b1f6de20f4ae46187483a4e10f8e9706fc8457685a7226afe8fd8d57f9281a31d6e791f2d1a325f7784369d225a86a33e6e45b7f2533d103fa228e35b2eb1c8c6837e46255558562f166b5097dc54daf8bf03935e5bb9914355ff34a626d4718cec4da3537c588c0dcf8a97ec7bc66b8444a31d32097ed869ab6fc6993e9e1fd71aaf52089c413d199b8af0e2d4550c72cfdc23365521ee4296578f10de1d31eff4e0569d2de83c1a2423d3b2dd28db2e090efb09e0f52fac1a86c422f9fb35f97871e42f6fa52cd8eb7db8962048bbc033d2c3c5b0e27fb473d55897f3096704c66cad7e4d8dca4122f2d276687e4e6a9ab5789c3b5346e4d616f9633ee25bdc44e41248bb48ed4b67e59c82e80d2eab929ad3f2db5493ae82593a597504ad55d98d8de9486f67989b72f8895866bad51d8d59a2938a873bbc4e15727e5535cc669b2bee63077fc0dbbf9b3e3fe26d1b749051cfee63a74c6dbf72ee1bfb13040d6a17a3166e81be6c5a5fd6d14c54867697b38eb443868e908c508c70ecd18630c8677705224de95ca6cee2824f7e2d4a643236395b7c06a998268d5ccd2dbd1f5b989dbcb6c22156ae4afdf278de1830eb4ac8fd7ca1f533b3a31af50e238e8af9663b2077e97be33437103a6b5a362476980ef712792a49465a8e059e8e6097bbcfbf71f43f0ab9f586c7c155c4d4b5cbcb5d2aa046a7b01fdb1a88fd8dd088080fb0e5cadc3afed027bedef7b0d41f4841ab3aa48a777e06ae242adb08898c66f4ecccc116df5055b9a6c3a9cb9abc4b57cd4796adebe3952f8d55fb61bdc4d38129ead557ba95dbfd6a33acf07d32342f558a406e517cae167496af7";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 128
    p_bin = (char *) "8060008000009ab00000099d000001e0054e8c800521000335615aba681218c62c065a02ce9d38270a0b8f564cd374c1dff8bbe53643be103c1dcc4b95925ed156bc14bd7722a765bea229d962afef660c2fb70d0811d88ad8fe0a29d33c6a9fcfb1dc94c3ff5e14261ee6828af64ab228de5ad50b2d81a79adac50a117d0b83be07b3f0aec3f7e1c9d30f0a1f3d1a1df1203f4b850ec94bed7f97fbe6a8d5547eba5d72c6035a90261dd4a407b773b17775208e3ac29c733ec4de0a7b9c71411f48ef8bb8128704714038838fd0a2e4a5ba98ed51139d24cbd4d53812479682d549eee05a5d8b131bc3617ad5d8c9243b88ceb1fe4da3feeb35b2deae2293066953491b64aae2b2b4ef76b1bffbfdc637fb7b34f97be4968d3df3598e8d03d29f94d5a0a3df7cc7c3ab598e4637af35ccca2d4b1e64cfbb60a856d0cac87d529ac6478e072c5621de9ffb1ec6aa81df96d0b18c2aeb679f4d6392b84d1d3dbc39b01c7a69f7c3f0e31af56fd051068c13d05a6f6d1ac0c7b5903ac265f944e5c2e7bc972880de310ab4f3c22747d0a39098b4852632bc2c3e4d87057292a318c4b1968d46db83f2561069333c947a32120f9b56dab6c8b1cd57dafe119e88865b0377885a3e9cb05cc5152d6e48c8fbb966a1d34179c307e9f7debfa8c348e4e32d4b0a2a5b660acf3c76deb376248d5fa3504889f57da8f1028407a79adae04cf49f5520a75e18e4e123ed889642f5e619fa5bcbc190809c25f051df663b170e656157c2b6f4c4989588920ad52ed08dcc53337efcc5b6dcb1a30ea84351ee54d2359726e1ff86920d783ee781182d80245b0af9a87d79166a0397573629857a648aa9ab0ef18147ae615349048c136536dac53a7749f078419695a469e771acce8792f356105e498256e20b505dee5c8dbca7c01ffeb3b8356fa863d710c85bbadc3ff1c84c91a7a17271170d4aa147000bb93a6e6cc4688b0b649cdc9a54356c4e01d5a92fd30c3aedba9aa71df2f65aae339e035998eac111c5739f6b32fc2d40c7a93c92ac4479bbb0d88ecaba4b7cb08ca412d3369fecd29f19e3c5eb054237645adca5e077bd5404b0884983be0c967f19f2df242c98f10103c36ccbacf5f909fa4569946e85ff2d6215077382cb58729532f2099ed373155b96d3f76a6b67833eb6ebbe6d6caafdd590c872cce73cd606377388e63b693c5f2190d0744bbf77fee9e24bc4b2616d5f12c65139a5c74cea09c74d30e131ad376b18c8c9bfd78b8141fb9c48be43cff493eeea9882ae9406c19ac88249c6990f8d5deb2b147323cd32c2019e1ccd7dde1b3848c9d64f9415e279b522ff11fb6b5864e22701822c81d9fefc77c511b6e584881538420a89ce89ef5fac8edbb2a7b980aafea5bd47bdd08cddcaababcfc96777ded68545b1be072fd8605646b748553296f9aed15860879fe868a9ab0e874b1cc573b07c52555ee933f4ce3e419baf19d05bf8a8a54b08b61e2b2fa6a9cf5d226ab3c78301827bb7e2445eef6f0642855e6b3541830c485f104e1c103ec225d244d38ed4f777aa0422474cc1be4c3998cc453b4efe3e3f16d1e59bee4aae9da689b9cdc80a23ae0e9cf41d8460e9891e4dac37f9841da75ed39a08104c4c7b0a30e86a9d3b08971169a66a78228f593bcf20869a7d098d8bd4565c55a894ac208cc14666f3f29da3be8cb7ee239e84a9e0afa56bbc7aefd7e59a5aaef86189f5d7c561856718cd94e4eccc63f8d9bb3be5a0de12371aa9559d2af5265918d5709f9ba91ab5af2d4cffdc5b44fe3b4eb697eb2721c8ce6ebba756fdccc57e5a3766d279510473c8ff93a238c5dfe5469ac1d5767e5f05b7d59914f9a6fd0a6a465176d55642e337b4b4898aa88f9bfcb63b62ed2eecc211ba2ff66aa6b8349a88d41ea740be0fe2779bc4fccc5058805608";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 129
    p_bin = (char *) "8060008100009ab00000099d000001e0054e8c8005210003356172b72d33529a684cfd247259245c55bc610b2fbf02f0482321ca493db6878dc9167959994b8622147d386cc7dbef240b2356f718dc45d5e0d310314df92a5518aff84da72e58cf54712e2a8d37691b41a64df363f2d054cbc572e17099b51dbbd4477b23fd6c863cef2a5fa8896d19fe8c1fdf5f559794f9392848301c284277772584c62bb7e8d29aa8949d2247da285569d5cd8ec24b3cd0bba43cf95e6e2a68ece55309a235268110703838b325e6a61c0c7219e9b65cc48ce14fded627e9d588d9b4b1ac473198fff191e3ad0cc9b71ec398b4d4c5dd46296aafc75d4e97f9303241f54ef94d67375c51e7e965cd49c4d8c9e997c69fcb6919ef2772e5385b90c1dae6a5338f4a0c07343daae851af4adcdad3bbbbd5beabdafabf464442668366a493e5fc510b698436df41d6ba122578a4496c57d6e5a58c959a944b352d3e535eeddc9965637ae5350f3ff173d835e575b68ff02c82b2ea3feabcde39e272f2b0a2b65da2fc9cb2e27f973d9e7877513b91240c076aab688494421e7f9138feff5dedcbd0b625e9c34229ad75dae26da073e0d4a6cff5ebb11a8af5bee23cdffed608c1290d5037ed18bc1077baf2b2e339384e4c4c863abc98457fdeccc8a4f59b9a6736c370ff75bb9b92f77859cfd221adb6adfd2effd6f6ba3ee639cc21a8f473639a5a2be248e289d934e3bb5213d7aa8b9bb060d765b9b9888e35b5152df0cb7d165253121c6f571109dee61fdfd2077a5815c3248fe5a7cded9c9318b7e5123d5747ebe5b6cc6fdab8a96e5313b59addb3a972cbd1b4edd737356acd725d2a4b979a8be5e0ed8d193abee4fe6e7c6d5e17d4fca64dd37f1d77777bbddde6c7bc80fbad9cdbd2ee07fae04679852f78466a561b81c45da920e5a21b52e5da51810e2a8d557314a0edd5db71f0a84444e78e91a516e5cf98b6f2fd3289dcbc98cf5b6d796411c399a3bc6f9539c93c9434d35562ed1eea7b3dc27de89c41827b297a920fcdf0c7c320cf4c0ddf01dd51dc38dc63ea602c79e04e9fd258d1280eca6a9d69d39849f2d1b352cc246a75b112c3736a27ce845e6e1f7fd5e5ef30fa71f965ddfdca63a4df92ab6cdb97242fcda6865917929a77f1173b0eed3b0f1fc2466e2647b6b2fc1984c44b621a3596cf876c2c1a84c423e5e5c3ecd62f34a3c0f5223dd644fd55a4cd70030758cf37bfd870532665b79f65c8dfe24e9372d159c7690c6eb106f95e5a1496c9b45f5b2ebf909a44314408b8ddc84f464bc9d09792cd1cbf16f541811adf3617f13fa6240bd2c717883afab357def7f34d74da7cda6ed79233eef5924d46ea92776dd552ee239b53e7e2725bf362757931d3195c924a5acba9793b9702cd73536a771392865512e2e138c265bd91cbd0d34fc418ec3ed97fe5a72f7f253341cd3e0e42af56aa8cebaad44e7a50c45b2e52298970007382b3ae5c76359ad753c0bed6c59470a16272a4fd5b339aae225a4d8c7be5f7ae2b53082b871ca4efcf97b2f22e5ec4be8caabd56bfd882e5302bec028b99cf0f77d0aa6fcb691f25b246d653bca24929afe264acfee7a24d61f2d99a2cec5f2da365bf2d3cd4f172f4d34f1167e6962eb11cd4d534fcbbaa25cb6b35f97465a5418e4be66cfb93620ca9c9055afe4999dc8a7a81082427c067a9294b1a954cc2b8ad6b31a5098fcaf8db4ed938f69805352a38b57bc352d68b6ed10207a4332be08cce831ba7440b19a9e5108686bc65bef645ead041d34cbfc4082897ba7893f0a1855397de5866f130c7fbdb3106b2f631c83069ed6af89b796944434ff96c721a24b58be6a4af5c9a32c2313c865cac7b3da939f50868d352d4afbabc6c044030186fe128e26192799e2ec61bc9e6b812c10e6ead507d1110135a18";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 130
    p_bin = (char *) "8060008200009ab00000099d000001e0054e8c8005210003356101d78813f9d9192774f958eb5b80dcf105b1ea94749dd1e3edfe4b88fef6f69072136f72cc2e133a30150d916b8fbe4c0032cbdb80f739af65867be15dc28fd690b93c0aa0d448951755537af924c6361b5e5b4b2c92ddd2a0e3115f35a363d4b9b1ba32dea47d92912d2c2aeb92f1bc2769d3bcf92735a35315aaddec82317f02684c66f1a04de174da2cef4719e16f2282e6e373881cec79759806b74211a3d5f5e048040337b48bcfc5c40702855047b9a107979a540758871a1555dcc8261355485c4775b1040c587ff0abf8c65e89caf3b6e2f4c86d7fac0d1217f264b5dde0d84fe45038e85dd9345557acd2b7bdbdd22e42ee4b74764512e58536c3e5e1c47d0444bb71ba3370a0ce9c7bcfe0f43ac862d10403e955ad8211aff324d333ff2372db36b1e692aa82eeeea9556f96ccc94d0a3f7638fc581788935b4e6625ff268c66ac4b7ef96f35199794cb2db9dffbdeb13a88e63e3961ed35639f308119cf9665b15ed5809a060c20e6d473d659bc0aa0847eebd74446644be7a4563cfefc0aa08f30afaabd94c112e7ae1c118bf3ea9770144d8e8d93d8101c2f23cbffaf90b25188878ae66821b581894ecef5cf319bac35dd4c55379af971ce6892dc80c5a5efcfb43bbf94d76de38e448abac7c84c763215063111e2eed21b341323fd2f93b97b45ff9b3f2fdebabb3494ffbae26d4de954820f968a91689745d36ddbecb1af41f7cb3239e691d75372cf94a10ee2f6c7f05e5936ff24f7aae68cfb8beeadb3398f9bb89602f7e5f620c30be9564cb9317554f2a533143b9a7a49398f2be6a79aca99b09cb185ff97c7d4ed72d51aa89e69582418166a9ac0da330ab0b9a7cb5f265a0bd208715966ca236f484a4baee8c7ffa6bbdb76c952522666d56eb963da7c8fbf90cb56bd9f1bed3ee2f5f725bfe5968a81faf965c634be4a526fdf1d41823e5ba6529be58de51358d77bab7e6b574c62ff45a8affbe5932a87e5ab64f36c3562b5517aaadf52778cb4bd4eb11cd1dee1a3096e37b371bc1794f648c6623cd96ee96d5eef965b967f2c773ae6b92318ff934a7d572c8ccb4b995774a6f6bfe27527f35a77e4e2fb9708d5569ad4945fe26cfa6b55331c812aaaad4d8ce9dd7cdb6e90be4d836865abe12b958cadd56a3f974cf48611e6a6955dc559e7ece90ccefacbdcee3bf7cd971f5addfd64d7cd465ca4b93689f22ff92b55f132310735a6aab1dcb29168ac3ad72d5daf9ace4c48572523e616b925639e9eeb86773d7cd6d5a4c97be5b632d1af788a73ec865aad7df31ec21dfbf9abf2decc9af88c94b6f69aaafb9ad4fb7cdb1a99be27274b93d31697863966d439ff9a98d0c6db4405f797be4e4928db091e9faaee93334a046d12a374ebbea59a55d5754f4fbf92e3faf7dd1aba3f7a9690fdd65bbee95afc968f9a92f39246e60bcd576db11cd93d35c96dda8634e8669a73e26ccff6117dc472d4ec9b35dcf4a5752482024396fdcf88eb96a6b4cda6895b4b55cdba6d796d0fb5d47efb96c9cdcd868d694577b725be6f1ccd72654a4fae6a72ea0615dfdd8c96cff7cf46c9cb15ec2d7e2d691320ed7f8427c4b196fdf652383eb1adf95e19e39eae25e5db3ca0d72cfd5175f965223c6a539f924ba77dd147a57ddf13077cd165e7365d495ae4b6f6babb966658deb97b44eb8479fb2486d5277e25f5cd6e7f4f70978ed8351b9a2977050bbf95329b19d2b8863b512feaf94b0854c7d6d9fb4c9ee9a2f232c1d3fbd4df272496825abc9c91e8d61bef8ab9a9554a6b2adb3567944734d84776bd734db4699392ad9bdf52b5fe4908366be5b9482f00c23c27249e9377717abe6bd549dd72d0dcd9edadbfebf094f8c754396052efbd90fd989f35f198ff34eea6a2";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 131
    p_bin = (char *) "80e0008300009ab00000099d000001e0019c8c80052100033561b9ad2689fb35b9acf423dada6b5c9a1a66cf2ef1fa0ceee5a4d417b374cb419cb197d71cf7aadde6e6c9952776923e6fbbcf1f88e3631be435a43ed566ddcb9ef249938e2d7abbc4f3546e2168c21c9cc949126e5e2e19729b3e6aee74f9ba67e25ff5dbfdfe2ab21048666f435b1721b6c96c20a2415b979a544b4fc448e977666d889cb34da572336a2b9aaf331e5cc44b7432725e927e48c77df768f895938b8cc6c3a36db7b896fcfdd29b3e2b6e3fd742557e4b397c57172e524cd54e2d3f5df4cbcf7e9d35eb9291eec2f77bb3272de48572e43196df24c628cd9be5a19208ebefd1a5d4367f7a063431c64e58dfbef8ad37725b313df74de4c7c251d5e8f8eac6ea5bddc24b58fa971ec74fb27276c772acba58f9a68c770c23e58fcab88844abb95afebdfcb63b47ef919fa9dd0cbcb6359ba52d7cb6aeebbd97d177f2748b85eec76cf52f35a43764b9b451e902cdf25d6ab92d15c667f2dd378d5c708a3c7346530d54fc89aa503ff19a97919a9a6fbc73dc9c92c104f53e6e4e5a18482fc9968d62f9286ef0af3648a0a5f74b2e92";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    p_st_conn->flg_has_master = FR_YES;
    p_st_conn->st_masterInfo.exp_src_ip = iptools_parse_ipaddr(TEST_RTP_SRC_IP);
    p_st_conn->st_masterInfo.exp_src_port = TEST_RTP_SRC_PORT;
    p_st_conn->st_masterInfo.exp_dst_ip = iptools_parse_ipaddr(TEST_RTP_DST_IP);
    p_st_conn->st_masterInfo.exp_dst_port = TEST_RTP_DST_PORT;

    unsigned long ul_invite_begin_timestamp;
    struct timeval st_timestamp_first;
    st_timestamp_first.tv_sec = 1454549154L;
    st_timestamp_first.tv_usec = 112233L;
    ul_invite_begin_timestamp = rtp_get_timestamp(&st_timestamp_first);
    char arr_invite_time[32] = {'\0'};
    snprintf(arr_invite_time, sizeof(arr_invite_time), "%lu", ul_invite_begin_timestamp);
    p_st_conn->st_masterInfo.p_lst_hdr_param = frlist_create();
    p_st_field = frvarfield_str(APM_SIP_INVITE_BEGIN_TIME, arr_invite_time);
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    p_st_field = frvarfield_str(APM_SIP_INVITE_PLAY_URI, "sip:42010606001320082255_1@10.72.1.125");
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    CU_ASSERT_TRUE(APM_L7_ANALYZE_IS_SUCC(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report)));

    // 测试结果
    Frlist_header *p_list_report = NULL;
    Frlist_node *p_st_node_report = NULL;
    Frreport_data *p_st_report_data = NULL;
    p_list_report = &((&st_hash_report)->p_list_array[0]);

    p_st_node_report = FRLIST_FIRST_NODE(p_list_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_node_report);

    p_st_report_data = (Frreport_data *) FRLIST_GET_NODE_DATA(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_report_data);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_SESSION_ID, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRSTRING);
    CU_ASSERT_STRING_EQUAL(p_st_field->field_value.p_value, TEST_RTP_SESSION_ID);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_ISRESPREQUIRED, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, FR_YES);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_START_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549154112LL);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_END_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549154112LL);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_SEND_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_DATA_BYTES, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_TRANS_TITLE, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRSTRING);
    CU_ASSERT_STRING_EQUAL(p_st_field->field_value.p_value, "PLAY sip:42010606001320082255_1@10.72.1.125");

    p_st_node_report = FRLIST_NEXT_NODE(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_node_report);

    p_st_report_data = (Frreport_data *) FRLIST_GET_NODE_DATA(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_report_data);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_START_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549354123L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_END_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549354123L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_SERVER_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 200011223L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_DOWNLOAD_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_DATA_BYTES, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 8712L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_RTP_REPORT_RESP_PACKETS_LOST, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 2L);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    test_rtp_destroy_ct(&p_st_conn);
    CU_ASSERT_PTR_NULL(p_st_conn);
}

/**
 * 异常测试
 * 共2个帧，第一帧序号从119到123，丢失了序号为123的包，第二帧序号从124到131
 */
static void __case4(void)
{
    Frlist_node *p_st_node = NULL;
    Frvar_field *p_st_field = NULL;
    Conntrack *p_st_conn = NULL;
    CU_ASSERT_EQUAL(test_rtp_create_ct(&p_st_conn, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT), FR_SUCC);

    // seq 119
    char *p_bin = (char *) "8060007700008ca00000099d000001ba44000c650401028f63f8";
    char arr_payload[65536] = {'\0'};
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    unsigned int ui_payload_len = strlen(p_bin) / 2;
    Apm_packet *p_st_packet = NULL;
    struct timeval st_timestamp;
    st_timestamp.tv_sec = 1454549354L;
    st_timestamp.tv_usec = 123456L;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    Frhash_header st_hash_report;
    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 120
    p_bin = (char *) "8060007800008ca00000099d000001e0054e8c800521000319410000000161f205450af09f71ef068892fdadf7a63239857bf798ab20b3a921813a6a4d8ba324e9ac5e094693ac253408e102bafbffc4f3474cfdfc993697920b1e047955996b9304faef708f363197f7cec97a6e909c5a34518d72609aa87fd9a33447a951b242b931f8ad64e582b72d804acdb81e469ef7c8707d1e03d48ff6197ab4125e3a040755db0bff9b2fb1f6424e2d25f43eaf75076f3c3a26ea45e9fc02a3a21d034dc958d9d94d2427b109ae75d63ca2a5f4ca322fa62dc877f9784bb2eca88e480bee07a54d79ddf14ba9b961c8fe2bb872b7ecd73466ffdf378febe123c67fdae1a56cf58de459e86384bdbd74ee2b420555932df3513b5e216a3ce0408c7b0d5c261ab9d465437734c944a51653b74926f703bda631d69c051ab84d9cfab519cc695f2a3e1023d6ee9567cb390a1b65a02436afed0ccfaabddc477dffaea571309ffe826fe1445fdf9cde3fefcff7cb3b29918fde35eb182f2c206df86eac1f06035db2e07bc9e66feef92d4bcaa1573ae845eb5c4f88707236ff92c0cf44710875cbcbc77d46df44a45a6f7ccdcac6977256116df6ab222e6923bb7f91c9e1f8f4ea38dd3e01f58f1b96cd33d8fb669577c92c1143cfbc4e4aaad66a9dadbe49b10435afee8f057c9b9391d9b46c15da2b2b31c4d65e471ccf419ab0dd49c15ba7c42aed5e6578256f5bf170e0cd1e46e561a10a353867dea5c7b3ebb91416118e35eb9b08870bd7be2b31887168a1423060469f7ae581233cae7feaaad3d6239b84c34d742f3470e13075adffc26e98c4ada6a7893be1960afc5a9760d62227c79256aaf1b5846f6bb91745cb46553ee99cd3588edb79b89acceb93914d29353fd277ee5e4f2191d8f4aeb692c4ded77ad2a6bed784355bf7babfb8ebe2dc8167e6718fa2c5b7e3354ab88e48774f47d6c4a471e373862f93ef082fef13cceccfff2633ffd4eb5d2bfc523cce7635920dc6c672c5563b73af8574565f6e66be979355b8ae4a525c7bd667bcbc329e6b3975fe909ed8fc22785ef155a5f22ea35ad535e47dc6724732fea6e63408db597f08ac0905c8d05b5208b73a6c1ffc177b75cd8ebeee8f8fe534051fcab61daea66cd73655e3603acd09f1e68a6ee3cd0e20f9735988342acd19e1d9e525f6834cb68469aa682351278f4c80f5d9e5a46eff735f3782cced5770a72c936a8d2fdff78ee46e925bae655cfdd147ebd2ea2f8a5844fae03b2f537c65cf13ca30c55f64807f7ae87ff24cfb32e5565b347262e2f88782fa1b0a3afd2be3f085bbfbf76e398efe4b2ada56f37a9237fab40f22718f32ffbcf069f7e47165b4bd528a5849c71844b3a256bd2d3452a8b50b5e3b92f546b99969a445bc9cd2d2953ded3ff221a88a7e977b71ec1bb73dda3ad46249e3052cc69089b469246a538c2f79170c5ac5e2ef1545aa8f6104df2b519a4debb0c5d38236996d86e7cbbef8476b90a6ef5e4efcd1d8846b883fef22131db7b8c675770c3c605cdf5dbebcd6ce5d83493cdd1962970e26c41d4c4df4e17e672948dcc56642d001fa683ea806960e15cebe318aee59d8206d2b342f215da8b803eeeb0a9ae8325a8ab45c8e8edce2563eca9cad98e9c0315f43562b71e5e0ab4556f96fe5d2618f642ab7c92eb5939234bee7d4577835ac7225c7254430fe28bc566dd48f23bf463f1391aa3fa32999f2dee5ee3431ee234cca1644d77743f195a112b656a74934dda6922fa2da331acd74dc29f7c9011adf5af2494477badd192cb97beb4b9665817cd4071e4b6fcad1023c820976523583cf5f760ee44b274ea9144cd4c96e9e3a448c4aff6f9b8df613e23c54f1b8644faf967c3e79e3370c0ad7e317fddb81eadf0524c18209bb55fee6814080742066abdcd9cb0f";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 121
    p_bin = (char *) "8060007900008ca00000099d000001e0054e8c80052100031941c300c52e9eaf23fbaf0b58f026defc701cc3fff3a716cfe9d111c2bc7e2f97dcca7df8f312026db9b75ed2a6d3e989ad7f7d24ad731235f963ff336b9bef4735e068d4e03f23a956c4cd79755b85dfb63177af4aed0eb583577a05d0a99050c875961a71a05a7f2492a8c5ff6cdada2a5ff16a5a188d065a6eac8115c247c7e21c847ca602498cab3136f5b472feee506083a620fefa9f0b22cb1b2de861144690fef843fd62b2dcc7153ceb8ae46701eae65d9aa2b53ea734091e055031096b4511ce23f8866de105d6970868a89996d47e5799742e0c55dd95d073333e9e1971e8fafbd61b3290be5acbd3ad7ae66a8b8d23ef23808930abfe4185d84cf6edb93b7973d5285364031980820d3d44301236cab9d1d60b58067e697be39f7c170e08b6867fc0426670549fcebb857ded47ab65cdfcf80031de2d0dd53483dfce598d1b1ce06bae8c7db587840bb3cef2eb07c1cfe8b112a067f13dab61ea2e909d8c29bbd1ae58ecf685f01b2dfa022cd1292c847d706a27963ae1fa372bb026c81fec7e5bcb9e2322f94901abea7a733a8fff4a09196fb2a68a90655dc4858df4dfffec2d9707622eb9700bee928ce58e9a30a10c46e70e1ce3a32dbe0a850f2a53d1a969b3660737e0e55efc08c30790da531a0a170d0f025e2aee988b4c662283a460b8a2919e475cf775cca2e0da6ec562ea26cf9cd9612e67b76b8b814e7172ece1c6815797b6d3aeb4e1154fedc9b7e5938e530f3c522b11ba6854c8dac15c82d4ec6423e4d6a68b53218aa273a109aef72d8441a83b8e8fac72885eaf1926c2fedcd845c0946e7d1fe11bfae3cb73e16eba0848b888e29c97776aed0af5b6ea2981ebc7beeb013ed3dbdfb92e69eb984031bcec792a0f0d102340d849ab69031f684ccb5a4ccb786083fce84147d6fe80eb31f3995fe3dbf11b73788ddff8a3e0cb510a4396f1cf1b8ea0430263a656a044dff37e4f4cc4550cc08f5bb7028ff8b6b4b9928efd201f7c691ee85a55499665f74664300cddede3e68b1335c091d73792c6019a53aed20d21366bfc9f0e234c5c2a8b091385086b33dd3b32c2394d41ff69a9f6e0fefc1f0c7e2067efcd89f89fb04c63c5e16d4a5d9c387e583ba2c246082e0f77104d2d8336539f35175bf11d22443beb4593a9cbe77aa04c23639639e89efe11be1f2e249563d1ad6f806238ea3d1f3f0751f8f4c552c7f03f6ae1961eaf1a92335bb5ae4d9971a6ebc9ca68165d69f7c37c7c23c25a8c118875267d92e65f1eea6f92d8d437a12e4115073d1d189631cab12c15458c29d5f081ae84dc6e6d7decd2e2e108f97336b9b6b28d7b40cbec280ff1d671bcb4c919a8990fc930ebae7a1a484ccf4610b6176131231152d8c3fcb11f73100a36ed32c2c7b88104ce692db1f25cc3271f068929489594e12048c0b98deb07deff85ce2ae2e3cf8f089df5a91db5fb8fb3063dd98cc7cfabae4ada6ab589fdc9c87a47fb2f118efef0c90bdf8ca5ccb8fc190adc98c77da409163933b6e2baa9f2c05b9d81c16ec154d8cee2310ac38d8bff87f2ff97d690e988574a7f63e1c3163bbfd060c249a2306211717467c8765faf173c036cbea765f9c09c10e084e266da5c9d9f8a48c96fbadad7604f0889841968966bb48f2d12ac522a2d8b3889856fc6735cef6169f70a725f3655d8b930ca939b355aafd8ae661472aa3fb658d2f3a6f26723399ff78cd330ce5fd4489440eabfc6ea2162a9b452d13536c5ac9b544d57ecbcd45a721388f081783e19a150721dd854beabf968c6a2feb8c2702b04b35c626afb5704e3caab4a8cbdccfc2b3adb5909592c3e7f9db3458cfb4b7685bd3abcaeb8cbc9b89ee6626625e496a8a9ae2319df5ad5c4b8abed7e89a331827add797a";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 122
    p_bin = (char *) "8060007a00008ca00000099d000001e0054e8c800521000319412578df1c53337af0703398e69fd97ae9711a9b98c34d5437e9cfb8eefb28dd615de3974bf59a14f6eeedf516d791afefee5f4e0a57ed4ac820d5433c3a786b957ad26dfade45c84e6269c9d0c1889c50c31ce6c6ffaac36790b539f8ffb44e4eb217a372ccc67dfc0aa15ae597abc5b579f70df22574e575c53e19aa5b6aba90d1ff7c4b67583e7574ec5107975860455a21a494ecedf5e45a254111c75ac5fbc821e189e7077df7a52e5797acbe23ac0b6159b93b47b1178307d727a2fa350409f3c7a542f909dbd6309ccb464fa5732e2cfaf99e5a1e9d7af461197077d58b6438fb7dfa080c0f19dddad1e06f0f93433f75097ea466c69abdc12ee3b993dd12e2b77772d1efc20eeef6f77777d936bed0e8c1f4da4d1c18e66d36935c54f4fd53bf97d6bb490dc5f64425e8f7111ff08c2b9c7e25a4ab9cb1afd92d72a31b06f8848cd18ce86cdcc734f667e36f8dd7dbdb4b30314e5b0b99ac19b53d611d43fcc26f2ff1e9ddcec3bd9d97a3763c1984c6443c51a9b98a314672096d7e36ddf2fc1a84c445628ddc518a37799295290aaf3dfad9894d3b423f4ea60305c31631efce1c1469b0b6f6d6b08baf456d2355d2db7d5fbfcde1eade89d2e4ec6969acd63fee8251f950fcb77a688b30feffe8519c987af25d06033b48eba1ab632bdebb132fb429bf04ea5c8adbb7e4969af076171f3e0a33e2eac434d535078627c080101770fb2170f1d0b58a4769e36cdea38acf4a7b58ee88f4bc6a39e620d3817caf9f6d8c65f2ef0bf03731e915e56fde2e2fc6b4a59e98ff93b0853c79492d339ac52e435277ccaa2a955f51ee0f786b01931cc7d507c7e56461763a1548ccfdd54fc3c4937d8d86a077708ee15e551bb1fdff063e0fc325aaaf076193656278cc2baaaeb3514a1361169be5b2924401ad51d3aebc352d68b6ea322a2bc77c89facafd9421f21353a3ed27a8de13c05740ee76fcef7d5b509ea32b0546ac4d8eeb4a2535801d78809fcec13362cb83e023deadf8670f10590eae48d13ba33efe7a7466709f23f5f0017118edb675b640fb42cce6b016a2d36f6fca00023e59b0d471194db0538484bad29706aed5b0c7ae619c40eccc5c386be15f7ddef7beeb3226c12d6ab17b8dddea4330821a048a7eda262b324da6b409e8fc641b2c6cbdecb1a43924813139085d8314cdf83b82414917a392018f1c5e0ff4353c085aae53199a92bd5941d3b4b233c4d40f5bedb81c9e1f46c0eea9ffce2aa6b53eac34baa32b4d3db0ad6f70ced20e527a398a70cd0a44256daf584bc03bf248b14e6bccfd0325c9901ee97c1e02213137e9fcf2d58f426e427fbc5a876ed53133a7755345d6e5351519eb475c76e513737641356deea3d34f61e7eb122e2cae895357c2b22c2ce3ccfe584b0c4399612c1736dc961dac377bbc72e842ee30698ad4f8b777182273df1eafc9d58f0b1a9a2dc5809e0583bd2574d5134b8b1c64e5569816413beb05f18eaf130ab89d55f53a226ca6e0af33296a7887158c94401d98f9f86c9fb0181e05e62dbfefc8e1a742e5c762b66816d62c865b4761dfae58e9132708556ea62b79a45ceeafd164cc0c4c8bdf9ee876f94d6446e0b792997e2eb1afa2237d7df17275cb776a937c4560b3708ee4dfaadfaf50c3d60db71b788dc16d6337ff26e5fc4fa8cbc3d5842f1536217ebeb25f33bcf51359def1d593704358a5f177f72eab965ed609ef55bd44ee6bc1cf25c99aad57bf5aac4de4bffac8d7823bc25796bdccf482f6a5e5acf7f34f1436a4e5da37c2758a5d462be2b719cbced3757939b6a3f97bb45ff88b30ce59ef8e6ff70ee6cea88acfcc9a77adcd7862b1b59f91c33f9f08bbe17d4132eafbe398c3ba9b725e054bc9ca8906ed82e59b1f";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 124
    p_bin = (char *) "8060007c00009ab00000099d000001ba44000cd58401028f63f8";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 125
    p_bin = (char *) "8060007d00009ab00000099d000001e0054e8c800521000335610000000161f40d142add46501c84204a5bbe2360ddea2e24d1a21c86e706912919b65fd7adea736edd585bbc41769f36999a3034b71448263fbac2177f233c5524e5dbcd5acbad3199635b549dc5d9133536a9456a7f9b425ae75cbbab6f5ab4b89c456a7628639c4c831f4074b96a0662b55109f7873e295e3b8dfd50f0b098481817f1ceeeac902a3aa77925603bebe3f0247e1607e751e437151d91c3ccb19316aafd057adf315a8cb46efd48425f4fc25d98f9b190d6bdf094c32f78d4ba0690c5dfee04fef9167022fd6d978d57a5d1621182edfc4638de7757a38f7fc676171a39d2d7f7889c148a772f18a0d79dfe5871fde4bdb92328286f5b53299b91b57d5eaa15a6fd11e61fe8b734da61841166fccfbeca370cbc76b90b913e389c3b823d18f983326f9cabcbe22c228818cd4a6772966ac9f8fd1b087229c407761e93328a6ba11049f65d6ed79b6b5b74f5c2f443443df2dba9a7e6c734b4eae466fc2769e908c040464343a1cab49736a930ab185863db05000101d91e8b800633b0502b1adda874024141bde06da805d2c19c4656a0a3bd008c70a26f91002020f402c0d801479a85140074000450e86826c65cb4dd378029a602d68802e0aded074a6603e8326d05156607ad302a0eced1687a2a659c69eb0703780aa14e2b0059d4800dc06c82c0dbc0740f019c022a5c8ee531927195498473b5aa5a4e43fa1607c50ebe6f4235919bcdc3f2fec2103595656ad36a3516c1d59fcac796c6ce8cd4f14637b0e761245576c68e155433d0959c91efeda4891c2922faf6b228f50f4a8600eb135cc551f618ad763b9c6091f63fd402bef66384d38eb2553a743c95297633fbdcc7c2479ef6cef529b859c3bc9c8ca48b15fc54682c2a7c32b47d2f0cba49903d77f843121a11797e2236dae93587269ed4695dfd594d46aa96a68edbdefb35ec86637c9756ff766eed745db218dae620d93fa6c97112e34622d374a3d1be5846ceb8fdeb5c5c76dfa4343107d39a8fcb5631cf7c279f6202039c63468b84adeab13cd13972e8e91d725e0808c445a87c5422ee4b7a39db8d90bc9631d1a237be93c4de5d044bce6d9b31b6af882b9a18dd20a837f2412357762d5f642c118e995fb8e0a0b6147ae686f5fea0bbdf1746ca1d6b81e91b747d2cf142506118c3e89018ad7d6a716d808473ab57ffe008924062b4195a878094041909e12023637f27d59ef714000407b8342c5038c02eee0145b604231c1b6a57f9587b19c240dd45c622ba595934915478796ed64af84a7b7e64a5f4f715d09cd5735eea6fd364632401b722f9d9d3d98d11910594ccb37a237dee4aac7d450c9e9da1e4ae19c66adc4e761fc12bdcf6659b197ea32b6a05d4eb0cde81deb10cf04104ecaff4e2ddbf7298d9cef0406aab71a9a9f56affd8c86fabf04177c9356fad9dd6880157b42e85e75477a46e22b0d872f230e77a5ca84a83dfb421bfba527bddbafe1fc994dc672f350c6a38820b0ef847b21cb3b7352c351a95e2b9d09ba25a1092e40da75216bfdfc613b79cc68328ac3501c03b8e376349353f170d8d3a37d04f658875a7d092c971d1a4db01ed7bc7b44df5ee9de6b067bb7e2a933497248d9e26ea6f114952d7cc474a533e6e1a65b26fe429e282bae248d61b2989214ae7756ab72fd7c21d197b27926da207035a89aaddeff13c3ce3710c686afe5b0308ddca3f8cb30f26ffafcd602d685f3184cf7334b62909ac66bd627fbff1d7d0439c3baaff3a20a0cfbdd7f295a365a3734f1bb9b9892561a756f7244a67ffb9c852f753d95f5e49f972f4f17ca4664f44b6cadcdedaff26adb456fb8e99fa1ad164c44533fb99f5d9784a3f2a2f1b3096f89e589d263dca2f74411a19ee734f944c";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 126
    p_bin = (char *) "8060007e00009ab00000099d000001e0054e8c800521000335612ee5812e632045746f4aec21b0825f3d900e0bd3f2bd5cde0c9e5c8d8e35cd471d1f0c5e26610d8f868156fb78c6ea466e63a1b4cdfcb673309788cfe4c9245a7e2aac3146a9ea36caf5f6696ea864ad731e98fc44fb3370923d171144da12f55038ff90e910cd49c93e90da7fbb18df32c9c96de4a178c30ed9ceb99e1efb0c217c47737b21d51f5c4e42438cb77a5f21f5246f48b1bc216756d6f9657cf59b931bb1fcbdced18f5fb9489feb925629a6f8bb663936de5cf17c39ac838ec8874155bdf1779eb8c55fc4ddd55f3eb8855dbff1f1c93d32eb2b66906dc667f9a7c1c1da8ff132e4b7a4dc95f08699698e47c095e71831f6fcb84b90d65b5dd6f9ad3afc2741247da8d60affbdf7f1070f5c57b3925b47bf66634b1f371794e994eca63e26f2be4f9f12beae6dc95df29804dee7fcdcf57d9e5343cfad2e844bd9f3c64b5cbced2a45dcb9933aa6b55c49b2c86fec2cba62de6b0a1ed6adbd231c7ee40bf8aa51eedda7dfc4dd58edc3113cb5c9e1a695691640e3194bdbe63518374430dfb3b43473d32ffbb73df7beeb5aa65b929b6ff363a3059fe593afb4ac4bcfc99586dc315cd3f6f7c278cd8cf56d2fba52ed3e8b1b69db3bd04e3dab98e5b77f8eda667cb27749b7f920be8d27d6d9e2f25943ad53a7ded125179773eeb84cc6cc741e276c8dd6f5c41d9a46dd03486ff41f9a4933797bb755fc2572d1f24d656ad972f4f2b5edadcda2f3f64b9319bd9b5c246c38f7c59a0abadd75c41f0dffaa3fe65b7b9656175a1f1f8b5592c766a0da79a31413a134c72dfe6d649be6e3bab4c49cd4ae93e6e1b6e9cda25da6be12bc6b2d90eb46191d64b9f9a9d528b8ee50a3611ac1fc283eb5197c71a686f182d208febbe47c9c411a33854a54333911ce6bf2908cd49d9bf7d68e8d1861aa5ffc55a76b186b7d7cd8e9bcc47f73f776a97247e579e04e5a336b5f966bd24f5ae6d335c32f199726c4126b4cba248d458cf8a45ff246ee2af51b695d557e4968ad5ec2775b48e4f6be5e6b0e6246bdbf5f099a71e3ce98b37edfef5d9db4e563dccc1689fe26d333d68e5a99064ee5ecf5cdc773d7369a64aa6ae5e366b5784b5c39b162a8c81f7e3747cdba6d775bf928dcc30c7ee3b8a7df7592fe5d986acbdbf09e6353d95821ad5c6435bbbede9b2cc7481fc2d1a69924c1ff4999ff9b2b6d9cfdcaf8fc7ca6a7cbaa33e3797c9c9251825bee8cd59da4e6e37a437c973cac15df5c4573e209a1d8f4759384ef497630fb52272cf1dd734a6326fcb5cb8b9294d46c9cdb6915fe69a966896be20cf2d13d90daf6cec22d58ecbcdda2f6d7a9dba648517899f688d51f9cf72f2531b19d727756aeb96ef465e26127c1dac8569637c46b926dd25b1daeea9cf068fedb435cd721b4d8c77ae88625ed6e63ed17f88c61f48f6eb26122b49c5daba4d1797167daeed745e1d47ae12abd6a5977584e7cbf22be4afcd96e42897bb73e5ae8c61b1aa937e97424ece2662a38323840675796bf71ed63a68dbeeb44c7ae27aef48b7f923865dcbcbe3374fc9c77df96e91883aafcba67cdd6f8ae907b16b4cf9a7a89de3522577f1148bf355f3f2d9c7dad3f2f686593eeccbf7c9a9f15def09cc44973c8686dafe6c65e9aebbf8ba4c6dab9e8943f17486db8876a81223523bfd566f0de255544ca652747b27274d5eb977971a4f2e71016e3dc9a44edf6b63ad72f41425116848b1dc51f881092770d8ebab1b929f944b3664b9e8d8e3f5b61057247cdbecfcd5a60856a3f5a844cda61ffddb5fcf6ee3e62fcb3e55e3a37f8fe38455712f3d3690221eebd6e7d668bc77c6a2e6888b9adea2ef350d0b20c66c42d5d5a843661a9abeec20ccd5835acf964f5f8fcde018bea8f2f213725b272";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 127
    p_bin = (char *) "8060007f00009ab00000099d000001e0054e8c800521000335611cac6a96b2779fd5ea5e4e90dcb15ddea8ef6fee88a90e41df2f72d1f36a79d7eed357f34e5e591e49bee7317b572736a596f84b1318ee4f365b46d5725b39c7aaaf24cdda47e2ace7c1e3832aa562af132b8a25bc87c9b02af25ded351f7e6a694b4f173de91e18516d551ebb923baee5ceadd63a34a12456df929bdff6c6e21f66b2c56c5f3490476bcd25cba731f142302ad0d2273346934dfc4b7669f35a0d4fd3528fe6c63dfcb5e91e979a30d63a0fe5cc447502bafc41de75c8d77912ba535f84ecc6971a3057df98c4ddd3ccb762a223b2a1f335bccfdaacfa544848e7be076d32c21757c79bb6364b52b7741806ffa9da30df43cf9ce13d6343a4fe9bc67768979f931ccb92f7dd10de3abc6a97746cc94fdc60c7b0bcd9711cf66e6898c7c5d2635a58779737d9773efe4b064caaee38bf2731b195b7cc7b8659dd34b6c4f2f38aa2a468d35def26f926a3e166b89b39ff2b048d2e6cad611cff16624abdb7708362fe6f0c26f3508f3c0c6826eb0c9e93913d473d32b0e9d7921338eaed8247a9a27ab7dae38cdc6c62d416a671fb99d8e92bf22171ecdb978606bdb832bb2229e27102ded73b4b5d52f4b46eed9acec28dda4692f96f34508646a433649e6bb13c87c73aeba21078d8ae77fdd8c26f19c59e5eba69cbd73515cc77c94aefe4906289d9f92ce99987cdb4abbba0e33ea077448b1003276e98f04dc358dc0215f4fc9a896e732de2d54b7a171884bf29c83bde17df946f6c805590ac7f5dca2f92ba06bdd396b641b8e5ae4a1626dae7e38965a061bad6d931dff5c278fafa43f1fd7658718d797f84ae95f19a5fbb435edbe5bcf0aee6cb5d7e5e6a25ee6f65f26632ddf925c66934b9379f3c46a358a9a44a347c4ffe22c1ee3b9931bfe6b7969e229c97d235f972635f84edb6d1e2490dcc6b7c86d33655612f19de6812589eee3c73df243da6af45e3b3a33864c079815b11dd3b5eeaac8875e927dc1dcd67d9a34b3e4e4ebded96ac376962a6e0f6c1b9cb109d974f50858c9b719c6de9f725b1f6de20f4ae46187483a4e10f8e9706fc8457685a7226afe8fd8d57f9281a31d6e791f2d1a325f7784369d225a86a33e6e45b7f2533d103fa228e35b2eb1c8c6837e46255558562f166b5097dc54daf8bf03935e5bb9914355ff34a626d4718cec4da3537c588c0dcf8a97ec7bc66b8444a31d32097ed869ab6fc6993e9e1fd71aaf52089c413d199b8af0e2d4550c72cfdc23365521ee4296578f10de1d31eff4e0569d2de83c1a2423d3b2dd28db2e090efb09e0f52fac1a86c422f9fb35f97871e42f6fa52cd8eb7db8962048bbc033d2c3c5b0e27fb473d55897f3096704c66cad7e4d8dca4122f2d276687e4e6a9ab5789c3b5346e4d616f9633ee25bdc44e41248bb48ed4b67e59c82e80d2eab929ad3f2db5493ae82593a597504ad55d98d8de9486f67989b72f8895866bad51d8d59a2938a873bbc4e15727e5535cc669b2bee63077fc0dbbf9b3e3fe26d1b749051cfee63a74c6dbf72ee1bfb13040d6a17a3166e81be6c5a5fd6d14c54867697b38eb443868e908c508c70ecd18630c8677705224de95ca6cee2824f7e2d4a643236395b7c06a998268d5ccd2dbd1f5b989dbcb6c22156ae4afdf278de1830eb4ac8fd7ca1f533b3a31af50e238e8af9663b2077e97be33437103a6b5a362476980ef712792a49465a8e059e8e6097bbcfbf71f43f0ab9f586c7c155c4d4b5cbcb5d2aa046a7b01fdb1a88fd8dd088080fb0e5cadc3afed027bedef7b0d41f4841ab3aa48a777e06ae242adb08898c66f4ecccc116df5055b9a6c3a9cb9abc4b57cd4796adebe3952f8d55fb61bdc4d38129ead557ba95dbfd6a33acf07d32342f558a406e517cae167496af7";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 128
    p_bin = (char *) "8060008000009ab00000099d000001e0054e8c800521000335615aba681218c62c065a02ce9d38270a0b8f564cd374c1dff8bbe53643be103c1dcc4b95925ed156bc14bd7722a765bea229d962afef660c2fb70d0811d88ad8fe0a29d33c6a9fcfb1dc94c3ff5e14261ee6828af64ab228de5ad50b2d81a79adac50a117d0b83be07b3f0aec3f7e1c9d30f0a1f3d1a1df1203f4b850ec94bed7f97fbe6a8d5547eba5d72c6035a90261dd4a407b773b17775208e3ac29c733ec4de0a7b9c71411f48ef8bb8128704714038838fd0a2e4a5ba98ed51139d24cbd4d53812479682d549eee05a5d8b131bc3617ad5d8c9243b88ceb1fe4da3feeb35b2deae2293066953491b64aae2b2b4ef76b1bffbfdc637fb7b34f97be4968d3df3598e8d03d29f94d5a0a3df7cc7c3ab598e4637af35ccca2d4b1e64cfbb60a856d0cac87d529ac6478e072c5621de9ffb1ec6aa81df96d0b18c2aeb679f4d6392b84d1d3dbc39b01c7a69f7c3f0e31af56fd051068c13d05a6f6d1ac0c7b5903ac265f944e5c2e7bc972880de310ab4f3c22747d0a39098b4852632bc2c3e4d87057292a318c4b1968d46db83f2561069333c947a32120f9b56dab6c8b1cd57dafe119e88865b0377885a3e9cb05cc5152d6e48c8fbb966a1d34179c307e9f7debfa8c348e4e32d4b0a2a5b660acf3c76deb376248d5fa3504889f57da8f1028407a79adae04cf49f5520a75e18e4e123ed889642f5e619fa5bcbc190809c25f051df663b170e656157c2b6f4c4989588920ad52ed08dcc53337efcc5b6dcb1a30ea84351ee54d2359726e1ff86920d783ee781182d80245b0af9a87d79166a0397573629857a648aa9ab0ef18147ae615349048c136536dac53a7749f078419695a469e771acce8792f356105e498256e20b505dee5c8dbca7c01ffeb3b8356fa863d710c85bbadc3ff1c84c91a7a17271170d4aa147000bb93a6e6cc4688b0b649cdc9a54356c4e01d5a92fd30c3aedba9aa71df2f65aae339e035998eac111c5739f6b32fc2d40c7a93c92ac4479bbb0d88ecaba4b7cb08ca412d3369fecd29f19e3c5eb054237645adca5e077bd5404b0884983be0c967f19f2df242c98f10103c36ccbacf5f909fa4569946e85ff2d6215077382cb58729532f2099ed373155b96d3f76a6b67833eb6ebbe6d6caafdd590c872cce73cd606377388e63b693c5f2190d0744bbf77fee9e24bc4b2616d5f12c65139a5c74cea09c74d30e131ad376b18c8c9bfd78b8141fb9c48be43cff493eeea9882ae9406c19ac88249c6990f8d5deb2b147323cd32c2019e1ccd7dde1b3848c9d64f9415e279b522ff11fb6b5864e22701822c81d9fefc77c511b6e584881538420a89ce89ef5fac8edbb2a7b980aafea5bd47bdd08cddcaababcfc96777ded68545b1be072fd8605646b748553296f9aed15860879fe868a9ab0e874b1cc573b07c52555ee933f4ce3e419baf19d05bf8a8a54b08b61e2b2fa6a9cf5d226ab3c78301827bb7e2445eef6f0642855e6b3541830c485f104e1c103ec225d244d38ed4f777aa0422474cc1be4c3998cc453b4efe3e3f16d1e59bee4aae9da689b9cdc80a23ae0e9cf41d8460e9891e4dac37f9841da75ed39a08104c4c7b0a30e86a9d3b08971169a66a78228f593bcf20869a7d098d8bd4565c55a894ac208cc14666f3f29da3be8cb7ee239e84a9e0afa56bbc7aefd7e59a5aaef86189f5d7c561856718cd94e4eccc63f8d9bb3be5a0de12371aa9559d2af5265918d5709f9ba91ab5af2d4cffdc5b44fe3b4eb697eb2721c8ce6ebba756fdccc57e5a3766d279510473c8ff93a238c5dfe5469ac1d5767e5f05b7d59914f9a6fd0a6a465176d55642e337b4b4898aa88f9bfcb63b62ed2eecc211ba2ff66aa6b8349a88d41ea740be0fe2779bc4fccc5058805608";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 129
    p_bin = (char *) "8060008100009ab00000099d000001e0054e8c8005210003356172b72d33529a684cfd247259245c55bc610b2fbf02f0482321ca493db6878dc9167959994b8622147d386cc7dbef240b2356f718dc45d5e0d310314df92a5518aff84da72e58cf54712e2a8d37691b41a64df363f2d054cbc572e17099b51dbbd4477b23fd6c863cef2a5fa8896d19fe8c1fdf5f559794f9392848301c284277772584c62bb7e8d29aa8949d2247da285569d5cd8ec24b3cd0bba43cf95e6e2a68ece55309a235268110703838b325e6a61c0c7219e9b65cc48ce14fded627e9d588d9b4b1ac473198fff191e3ad0cc9b71ec398b4d4c5dd46296aafc75d4e97f9303241f54ef94d67375c51e7e965cd49c4d8c9e997c69fcb6919ef2772e5385b90c1dae6a5338f4a0c07343daae851af4adcdad3bbbbd5beabdafabf464442668366a493e5fc510b698436df41d6ba122578a4496c57d6e5a58c959a944b352d3e535eeddc9965637ae5350f3ff173d835e575b68ff02c82b2ea3feabcde39e272f2b0a2b65da2fc9cb2e27f973d9e7877513b91240c076aab688494421e7f9138feff5dedcbd0b625e9c34229ad75dae26da073e0d4a6cff5ebb11a8af5bee23cdffed608c1290d5037ed18bc1077baf2b2e339384e4c4c863abc98457fdeccc8a4f59b9a6736c370ff75bb9b92f77859cfd221adb6adfd2effd6f6ba3ee639cc21a8f473639a5a2be248e289d934e3bb5213d7aa8b9bb060d765b9b9888e35b5152df0cb7d165253121c6f571109dee61fdfd2077a5815c3248fe5a7cded9c9318b7e5123d5747ebe5b6cc6fdab8a96e5313b59addb3a972cbd1b4edd737356acd725d2a4b979a8be5e0ed8d193abee4fe6e7c6d5e17d4fca64dd37f1d77777bbddde6c7bc80fbad9cdbd2ee07fae04679852f78466a561b81c45da920e5a21b52e5da51810e2a8d557314a0edd5db71f0a84444e78e91a516e5cf98b6f2fd3289dcbc98cf5b6d796411c399a3bc6f9539c93c9434d35562ed1eea7b3dc27de89c41827b297a920fcdf0c7c320cf4c0ddf01dd51dc38dc63ea602c79e04e9fd258d1280eca6a9d69d39849f2d1b352cc246a75b112c3736a27ce845e6e1f7fd5e5ef30fa71f965ddfdca63a4df92ab6cdb97242fcda6865917929a77f1173b0eed3b0f1fc2466e2647b6b2fc1984c44b621a3596cf876c2c1a84c423e5e5c3ecd62f34a3c0f5223dd644fd55a4cd70030758cf37bfd870532665b79f65c8dfe24e9372d159c7690c6eb106f95e5a1496c9b45f5b2ebf909a44314408b8ddc84f464bc9d09792cd1cbf16f541811adf3617f13fa6240bd2c717883afab357def7f34d74da7cda6ed79233eef5924d46ea92776dd552ee239b53e7e2725bf362757931d3195c924a5acba9793b9702cd73536a771392865512e2e138c265bd91cbd0d34fc418ec3ed97fe5a72f7f253341cd3e0e42af56aa8cebaad44e7a50c45b2e52298970007382b3ae5c76359ad753c0bed6c59470a16272a4fd5b339aae225a4d8c7be5f7ae2b53082b871ca4efcf97b2f22e5ec4be8caabd56bfd882e5302bec028b99cf0f77d0aa6fcb691f25b246d653bca24929afe264acfee7a24d61f2d99a2cec5f2da365bf2d3cd4f172f4d34f1167e6962eb11cd4d534fcbbaa25cb6b35f97465a5418e4be66cfb93620ca9c9055afe4999dc8a7a81082427c067a9294b1a954cc2b8ad6b31a5098fcaf8db4ed938f69805352a38b57bc352d68b6ed10207a4332be08cce831ba7440b19a9e5108686bc65bef645ead041d34cbfc4082897ba7893f0a1855397de5866f130c7fbdb3106b2f631c83069ed6af89b796944434ff96c721a24b58be6a4af5c9a32c2313c865cac7b3da939f50868d352d4afbabc6c044030186fe128e26192799e2ec61bc9e6b812c10e6ead507d1110135a18";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 130
    p_bin = (char *) "8060008200009ab00000099d000001e0054e8c8005210003356101d78813f9d9192774f958eb5b80dcf105b1ea94749dd1e3edfe4b88fef6f69072136f72cc2e133a30150d916b8fbe4c0032cbdb80f739af65867be15dc28fd690b93c0aa0d448951755537af924c6361b5e5b4b2c92ddd2a0e3115f35a363d4b9b1ba32dea47d92912d2c2aeb92f1bc2769d3bcf92735a35315aaddec82317f02684c66f1a04de174da2cef4719e16f2282e6e373881cec79759806b74211a3d5f5e048040337b48bcfc5c40702855047b9a107979a540758871a1555dcc8261355485c4775b1040c587ff0abf8c65e89caf3b6e2f4c86d7fac0d1217f264b5dde0d84fe45038e85dd9345557acd2b7bdbdd22e42ee4b74764512e58536c3e5e1c47d0444bb71ba3370a0ce9c7bcfe0f43ac862d10403e955ad8211aff324d333ff2372db36b1e692aa82eeeea9556f96ccc94d0a3f7638fc581788935b4e6625ff268c66ac4b7ef96f35199794cb2db9dffbdeb13a88e63e3961ed35639f308119cf9665b15ed5809a060c20e6d473d659bc0aa0847eebd74446644be7a4563cfefc0aa08f30afaabd94c112e7ae1c118bf3ea9770144d8e8d93d8101c2f23cbffaf90b25188878ae66821b581894ecef5cf319bac35dd4c55379af971ce6892dc80c5a5efcfb43bbf94d76de38e448abac7c84c763215063111e2eed21b341323fd2f93b97b45ff9b3f2fdebabb3494ffbae26d4de954820f968a91689745d36ddbecb1af41f7cb3239e691d75372cf94a10ee2f6c7f05e5936ff24f7aae68cfb8beeadb3398f9bb89602f7e5f620c30be9564cb9317554f2a533143b9a7a49398f2be6a79aca99b09cb185ff97c7d4ed72d51aa89e69582418166a9ac0da330ab0b9a7cb5f265a0bd208715966ca236f484a4baee8c7ffa6bbdb76c952522666d56eb963da7c8fbf90cb56bd9f1bed3ee2f5f725bfe5968a81faf965c634be4a526fdf1d41823e5ba6529be58de51358d77bab7e6b574c62ff45a8affbe5932a87e5ab64f36c3562b5517aaadf52778cb4bd4eb11cd1dee1a3096e37b371bc1794f648c6623cd96ee96d5eef965b967f2c773ae6b92318ff934a7d572c8ccb4b995774a6f6bfe27527f35a77e4e2fb9708d5569ad4945fe26cfa6b55331c812aaaad4d8ce9dd7cdb6e90be4d836865abe12b958cadd56a3f974cf48611e6a6955dc559e7ece90ccefacbdcee3bf7cd971f5addfd64d7cd465ca4b93689f22ff92b55f132310735a6aab1dcb29168ac3ad72d5daf9ace4c48572523e616b925639e9eeb86773d7cd6d5a4c97be5b632d1af788a73ec865aad7df31ec21dfbf9abf2decc9af88c94b6f69aaafb9ad4fb7cdb1a99be27274b93d31697863966d439ff9a98d0c6db4405f797be4e4928db091e9faaee93334a046d12a374ebbea59a55d5754f4fbf92e3faf7dd1aba3f7a9690fdd65bbee95afc968f9a92f39246e60bcd576db11cd93d35c96dda8634e8669a73e26ccff6117dc472d4ec9b35dcf4a5752482024396fdcf88eb96a6b4cda6895b4b55cdba6d796d0fb5d47efb96c9cdcd868d694577b725be6f1ccd72654a4fae6a72ea0615dfdd8c96cff7cf46c9cb15ec2d7e2d691320ed7f8427c4b196fdf652383eb1adf95e19e39eae25e5db3ca0d72cfd5175f965223c6a539f924ba77dd147a57ddf13077cd165e7365d495ae4b6f6babb966658deb97b44eb8479fb2486d5277e25f5cd6e7f4f70978ed8351b9a2977050bbf95329b19d2b8863b512feaf94b0854c7d6d9fb4c9ee9a2f232c1d3fbd4df272496825abc9c91e8d61bef8ab9a9554a6b2adb3567944734d84776bd734db4699392ad9bdf52b5fe4908366be5b9482f00c23c27249e9377717abe6bd549dd72d0dcd9edadbfebf094f8c754396052efbd90fd989f35f198ff34eea6a2";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 131
    p_bin = (char *) "80e0008300009ab00000099d000001e0019c8c80052100033561b9ad2689fb35b9acf423dada6b5c9a1a66cf2ef1fa0ceee5a4d417b374cb419cb197d71cf7aadde6e6c9952776923e6fbbcf1f88e3631be435a43ed566ddcb9ef249938e2d7abbc4f3546e2168c21c9cc949126e5e2e19729b3e6aee74f9ba67e25ff5dbfdfe2ab21048666f435b1721b6c96c20a2415b979a544b4fc448e977666d889cb34da572336a2b9aaf331e5cc44b7432725e927e48c77df768f895938b8cc6c3a36db7b896fcfdd29b3e2b6e3fd742557e4b397c57172e524cd54e2d3f5df4cbcf7e9d35eb9291eec2f77bb3272de48572e43196df24c628cd9be5a19208ebefd1a5d4367f7a063431c64e58dfbef8ad37725b313df74de4c7c251d5e8f8eac6ea5bddc24b58fa971ec74fb27276c772acba58f9a68c770c23e58fcab88844abb95afebdfcb63b47ef919fa9dd0cbcb6359ba52d7cb6aeebbd97d177f2748b85eec76cf52f35a43764b9b451e902cdf25d6ab92d15c667f2dd378d5c708a3c7346530d54fc89aa503ff19a97919a9a6fbc73dc9c92c104f53e6e4e5a18482fc9968d62f9286ef0af3648a0a5f74b2e92";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    p_st_conn->flg_has_master = FR_YES;
    p_st_conn->st_masterInfo.exp_src_ip = iptools_parse_ipaddr(TEST_RTP_SRC_IP);
    p_st_conn->st_masterInfo.exp_src_port = TEST_RTP_SRC_PORT;
    p_st_conn->st_masterInfo.exp_dst_ip = iptools_parse_ipaddr(TEST_RTP_DST_IP);
    p_st_conn->st_masterInfo.exp_dst_port = TEST_RTP_DST_PORT;

    unsigned long ul_invite_begin_timestamp;
    struct timeval st_timestamp_first;
    st_timestamp_first.tv_sec = 1454549154L;
    st_timestamp_first.tv_usec = 112233L;
    ul_invite_begin_timestamp = rtp_get_timestamp(&st_timestamp_first);
    char arr_invite_time[32] = {'\0'};
    snprintf(arr_invite_time, sizeof(arr_invite_time), "%lu", ul_invite_begin_timestamp);
    p_st_conn->st_masterInfo.p_lst_hdr_param = frlist_create();
    p_st_field = frvarfield_str(APM_SIP_INVITE_BEGIN_TIME, arr_invite_time);
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    p_st_field = frvarfield_str(APM_SIP_INVITE_PLAY_URI, "sip:42010606001320082255_1@10.72.1.125");
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    CU_ASSERT_TRUE(APM_L7_ANALYZE_IS_SUCC(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report)));

    // 测试结果
    Frlist_header *p_list_report = NULL;
    Frlist_node *p_st_node_report = NULL;
    Frreport_data *p_st_report_data = NULL;
    p_list_report = &((&st_hash_report)->p_list_array[0]);

    p_st_node_report = FRLIST_FIRST_NODE(p_list_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_node_report);

    p_st_report_data = (Frreport_data *) FRLIST_GET_NODE_DATA(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_report_data);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_SESSION_ID, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRSTRING);
    CU_ASSERT_STRING_EQUAL(p_st_field->field_value.p_value, TEST_RTP_SESSION_ID);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_ISRESPREQUIRED, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, FR_YES);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_START_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549154112LL);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_END_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549154112LL);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_SEND_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_REQ_DATA_BYTES, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_TRANS_TITLE, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRSTRING);
    CU_ASSERT_STRING_EQUAL(p_st_field->field_value.p_value, "PLAY sip:42010606001320082255_1@10.72.1.125");

    p_st_node_report = FRLIST_NEXT_NODE(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_node_report);

    p_st_report_data = (Frreport_data *) FRLIST_GET_NODE_DATA(p_st_node_report);
    CU_ASSERT_PTR_NOT_NULL(p_st_report_data);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_START_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549354123L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_END_TIMESTAMP, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1454549354123L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_SERVER_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 200011223L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_DOWNLOAD_TIME_US, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 0);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_REPORT_KEY_RESP_DATA_BYTES, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 8712L);

    p_st_field = FrReportOpt_get_field(p_st_report_data, APM_RTP_REPORT_RESP_PACKETS_LOST, 0);
    CU_ASSERT_EQUAL(p_st_field->em_data_type, FRLONG);
    CU_ASSERT_EQUAL(p_st_field->field_value.ll_value, 1L);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    test_rtp_destroy_ct(&p_st_conn);
    CU_ASSERT_PTR_NULL(p_st_conn);
}

/**
 * 边界测试
 * 共2个帧，第一帧序号从119到123，丢失了序号为122,123的包，第二帧序号从124到131
 */
static void __case5(void)
{
    Frlist_node *p_st_node = NULL;
    Frvar_field *p_st_field = NULL;
    Conntrack *p_st_conn = NULL;
    CU_ASSERT_EQUAL(test_rtp_create_ct(&p_st_conn, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT), FR_SUCC);

    // seq 119
    char *p_bin = (char *) "8060007700008ca00000099d000001ba44000c650401028f63f8";
    char arr_payload[65536] = {'\0'};
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    unsigned int ui_payload_len = strlen(p_bin) / 2;
    Apm_packet *p_st_packet = NULL;
    struct timeval st_timestamp;
    st_timestamp.tv_sec = 1454549354L;
    st_timestamp.tv_usec = 123456L;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    Frhash_header st_hash_report;
    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 120
    p_bin = (char *) "8060007800008ca00000099d000001e0054e8c800521000319410000000161f205450af09f71ef068892fdadf7a63239857bf798ab20b3a921813a6a4d8ba324e9ac5e094693ac253408e102bafbffc4f3474cfdfc993697920b1e047955996b9304faef708f363197f7cec97a6e909c5a34518d72609aa87fd9a33447a951b242b931f8ad64e582b72d804acdb81e469ef7c8707d1e03d48ff6197ab4125e3a040755db0bff9b2fb1f6424e2d25f43eaf75076f3c3a26ea45e9fc02a3a21d034dc958d9d94d2427b109ae75d63ca2a5f4ca322fa62dc877f9784bb2eca88e480bee07a54d79ddf14ba9b961c8fe2bb872b7ecd73466ffdf378febe123c67fdae1a56cf58de459e86384bdbd74ee2b420555932df3513b5e216a3ce0408c7b0d5c261ab9d465437734c944a51653b74926f703bda631d69c051ab84d9cfab519cc695f2a3e1023d6ee9567cb390a1b65a02436afed0ccfaabddc477dffaea571309ffe826fe1445fdf9cde3fefcff7cb3b29918fde35eb182f2c206df86eac1f06035db2e07bc9e66feef92d4bcaa1573ae845eb5c4f88707236ff92c0cf44710875cbcbc77d46df44a45a6f7ccdcac6977256116df6ab222e6923bb7f91c9e1f8f4ea38dd3e01f58f1b96cd33d8fb669577c92c1143cfbc4e4aaad66a9dadbe49b10435afee8f057c9b9391d9b46c15da2b2b31c4d65e471ccf419ab0dd49c15ba7c42aed5e6578256f5bf170e0cd1e46e561a10a353867dea5c7b3ebb91416118e35eb9b08870bd7be2b31887168a1423060469f7ae581233cae7feaaad3d6239b84c34d742f3470e13075adffc26e98c4ada6a7893be1960afc5a9760d62227c79256aaf1b5846f6bb91745cb46553ee99cd3588edb79b89acceb93914d29353fd277ee5e4f2191d8f4aeb692c4ded77ad2a6bed784355bf7babfb8ebe2dc8167e6718fa2c5b7e3354ab88e48774f47d6c4a471e373862f93ef082fef13cceccfff2633ffd4eb5d2bfc523cce7635920dc6c672c5563b73af8574565f6e66be979355b8ae4a525c7bd667bcbc329e6b3975fe909ed8fc22785ef155a5f22ea35ad535e47dc6724732fea6e63408db597f08ac0905c8d05b5208b73a6c1ffc177b75cd8ebeee8f8fe534051fcab61daea66cd73655e3603acd09f1e68a6ee3cd0e20f9735988342acd19e1d9e525f6834cb68469aa682351278f4c80f5d9e5a46eff735f3782cced5770a72c936a8d2fdff78ee46e925bae655cfdd147ebd2ea2f8a5844fae03b2f537c65cf13ca30c55f64807f7ae87ff24cfb32e5565b347262e2f88782fa1b0a3afd2be3f085bbfbf76e398efe4b2ada56f37a9237fab40f22718f32ffbcf069f7e47165b4bd528a5849c71844b3a256bd2d3452a8b50b5e3b92f546b99969a445bc9cd2d2953ded3ff221a88a7e977b71ec1bb73dda3ad46249e3052cc69089b469246a538c2f79170c5ac5e2ef1545aa8f6104df2b519a4debb0c5d38236996d86e7cbbef8476b90a6ef5e4efcd1d8846b883fef22131db7b8c675770c3c605cdf5dbebcd6ce5d83493cdd1962970e26c41d4c4df4e17e672948dcc56642d001fa683ea806960e15cebe318aee59d8206d2b342f215da8b803eeeb0a9ae8325a8ab45c8e8edce2563eca9cad98e9c0315f43562b71e5e0ab4556f96fe5d2618f642ab7c92eb5939234bee7d4577835ac7225c7254430fe28bc566dd48f23bf463f1391aa3fa32999f2dee5ee3431ee234cca1644d77743f195a112b656a74934dda6922fa2da331acd74dc29f7c9011adf5af2494477badd192cb97beb4b9665817cd4071e4b6fcad1023c820976523583cf5f760ee44b274ea9144cd4c96e9e3a448c4aff6f9b8df613e23c54f1b8644faf967c3e79e3370c0ad7e317fddb81eadf0524c18209bb55fee6814080742066abdcd9cb0f";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 121
    p_bin = (char *) "8060007900008ca00000099d000001e0054e8c80052100031941c300c52e9eaf23fbaf0b58f026defc701cc3fff3a716cfe9d111c2bc7e2f97dcca7df8f312026db9b75ed2a6d3e989ad7f7d24ad731235f963ff336b9bef4735e068d4e03f23a956c4cd79755b85dfb63177af4aed0eb583577a05d0a99050c875961a71a05a7f2492a8c5ff6cdada2a5ff16a5a188d065a6eac8115c247c7e21c847ca602498cab3136f5b472feee506083a620fefa9f0b22cb1b2de861144690fef843fd62b2dcc7153ceb8ae46701eae65d9aa2b53ea734091e055031096b4511ce23f8866de105d6970868a89996d47e5799742e0c55dd95d073333e9e1971e8fafbd61b3290be5acbd3ad7ae66a8b8d23ef23808930abfe4185d84cf6edb93b7973d5285364031980820d3d44301236cab9d1d60b58067e697be39f7c170e08b6867fc0426670549fcebb857ded47ab65cdfcf80031de2d0dd53483dfce598d1b1ce06bae8c7db587840bb3cef2eb07c1cfe8b112a067f13dab61ea2e909d8c29bbd1ae58ecf685f01b2dfa022cd1292c847d706a27963ae1fa372bb026c81fec7e5bcb9e2322f94901abea7a733a8fff4a09196fb2a68a90655dc4858df4dfffec2d9707622eb9700bee928ce58e9a30a10c46e70e1ce3a32dbe0a850f2a53d1a969b3660737e0e55efc08c30790da531a0a170d0f025e2aee988b4c662283a460b8a2919e475cf775cca2e0da6ec562ea26cf9cd9612e67b76b8b814e7172ece1c6815797b6d3aeb4e1154fedc9b7e5938e530f3c522b11ba6854c8dac15c82d4ec6423e4d6a68b53218aa273a109aef72d8441a83b8e8fac72885eaf1926c2fedcd845c0946e7d1fe11bfae3cb73e16eba0848b888e29c97776aed0af5b6ea2981ebc7beeb013ed3dbdfb92e69eb984031bcec792a0f0d102340d849ab69031f684ccb5a4ccb786083fce84147d6fe80eb31f3995fe3dbf11b73788ddff8a3e0cb510a4396f1cf1b8ea0430263a656a044dff37e4f4cc4550cc08f5bb7028ff8b6b4b9928efd201f7c691ee85a55499665f74664300cddede3e68b1335c091d73792c6019a53aed20d21366bfc9f0e234c5c2a8b091385086b33dd3b32c2394d41ff69a9f6e0fefc1f0c7e2067efcd89f89fb04c63c5e16d4a5d9c387e583ba2c246082e0f77104d2d8336539f35175bf11d22443beb4593a9cbe77aa04c23639639e89efe11be1f2e249563d1ad6f806238ea3d1f3f0751f8f4c552c7f03f6ae1961eaf1a92335bb5ae4d9971a6ebc9ca68165d69f7c37c7c23c25a8c118875267d92e65f1eea6f92d8d437a12e4115073d1d189631cab12c15458c29d5f081ae84dc6e6d7decd2e2e108f97336b9b6b28d7b40cbec280ff1d671bcb4c919a8990fc930ebae7a1a484ccf4610b6176131231152d8c3fcb11f73100a36ed32c2c7b88104ce692db1f25cc3271f068929489594e12048c0b98deb07deff85ce2ae2e3cf8f089df5a91db5fb8fb3063dd98cc7cfabae4ada6ab589fdc9c87a47fb2f118efef0c90bdf8ca5ccb8fc190adc98c77da409163933b6e2baa9f2c05b9d81c16ec154d8cee2310ac38d8bff87f2ff97d690e988574a7f63e1c3163bbfd060c249a2306211717467c8765faf173c036cbea765f9c09c10e084e266da5c9d9f8a48c96fbadad7604f0889841968966bb48f2d12ac522a2d8b3889856fc6735cef6169f70a725f3655d8b930ca939b355aafd8ae661472aa3fb658d2f3a6f26723399ff78cd330ce5fd4489440eabfc6ea2162a9b452d13536c5ac9b544d57ecbcd45a721388f081783e19a150721dd854beabf968c6a2feb8c2702b04b35c626afb5704e3caab4a8cbdccfc2b3adb5909592c3e7f9db3458cfb4b7685bd3abcaeb8cbc9b89ee6626625e496a8a9ae2319df5ad5c4b8abed7e89a331827add797a";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 124
    p_bin = (char *) "8060007c00009ab00000099d000001ba44000cd58401028f63f8";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 125
    p_bin = (char *) "8060007d00009ab00000099d000001e0054e8c800521000335610000000161f40d142add46501c84204a5bbe2360ddea2e24d1a21c86e706912919b65fd7adea736edd585bbc41769f36999a3034b71448263fbac2177f233c5524e5dbcd5acbad3199635b549dc5d9133536a9456a7f9b425ae75cbbab6f5ab4b89c456a7628639c4c831f4074b96a0662b55109f7873e295e3b8dfd50f0b098481817f1ceeeac902a3aa77925603bebe3f0247e1607e751e437151d91c3ccb19316aafd057adf315a8cb46efd48425f4fc25d98f9b190d6bdf094c32f78d4ba0690c5dfee04fef9167022fd6d978d57a5d1621182edfc4638de7757a38f7fc676171a39d2d7f7889c148a772f18a0d79dfe5871fde4bdb92328286f5b53299b91b57d5eaa15a6fd11e61fe8b734da61841166fccfbeca370cbc76b90b913e389c3b823d18f983326f9cabcbe22c228818cd4a6772966ac9f8fd1b087229c407761e93328a6ba11049f65d6ed79b6b5b74f5c2f443443df2dba9a7e6c734b4eae466fc2769e908c040464343a1cab49736a930ab185863db05000101d91e8b800633b0502b1adda874024141bde06da805d2c19c4656a0a3bd008c70a26f91002020f402c0d801479a85140074000450e86826c65cb4dd378029a602d68802e0aded074a6603e8326d05156607ad302a0eced1687a2a659c69eb0703780aa14e2b0059d4800dc06c82c0dbc0740f019c022a5c8ee531927195498473b5aa5a4e43fa1607c50ebe6f4235919bcdc3f2fec2103595656ad36a3516c1d59fcac796c6ce8cd4f14637b0e761245576c68e155433d0959c91efeda4891c2922faf6b228f50f4a8600eb135cc551f618ad763b9c6091f63fd402bef66384d38eb2553a743c95297633fbdcc7c2479ef6cef529b859c3bc9c8ca48b15fc54682c2a7c32b47d2f0cba49903d77f843121a11797e2236dae93587269ed4695dfd594d46aa96a68edbdefb35ec86637c9756ff766eed745db218dae620d93fa6c97112e34622d374a3d1be5846ceb8fdeb5c5c76dfa4343107d39a8fcb5631cf7c279f6202039c63468b84adeab13cd13972e8e91d725e0808c445a87c5422ee4b7a39db8d90bc9631d1a237be93c4de5d044bce6d9b31b6af882b9a18dd20a837f2412357762d5f642c118e995fb8e0a0b6147ae686f5fea0bbdf1746ca1d6b81e91b747d2cf142506118c3e89018ad7d6a716d808473ab57ffe008924062b4195a878094041909e12023637f27d59ef714000407b8342c5038c02eee0145b604231c1b6a57f9587b19c240dd45c622ba595934915478796ed64af84a7b7e64a5f4f715d09cd5735eea6fd364632401b722f9d9d3d98d11910594ccb37a237dee4aac7d450c9e9da1e4ae19c66adc4e761fc12bdcf6659b197ea32b6a05d4eb0cde81deb10cf04104ecaff4e2ddbf7298d9cef0406aab71a9a9f56affd8c86fabf04177c9356fad9dd6880157b42e85e75477a46e22b0d872f230e77a5ca84a83dfb421bfba527bddbafe1fc994dc672f350c6a38820b0ef847b21cb3b7352c351a95e2b9d09ba25a1092e40da75216bfdfc613b79cc68328ac3501c03b8e376349353f170d8d3a37d04f658875a7d092c971d1a4db01ed7bc7b44df5ee9de6b067bb7e2a933497248d9e26ea6f114952d7cc474a533e6e1a65b26fe429e282bae248d61b2989214ae7756ab72fd7c21d197b27926da207035a89aaddeff13c3ce3710c686afe5b0308ddca3f8cb30f26ffafcd602d685f3184cf7334b62909ac66bd627fbff1d7d0439c3baaff3a20a0cfbdd7f295a365a3734f1bb9b9892561a756f7244a67ffb9c852f753d95f5e49f972f4f17ca4664f44b6cadcdedaff26adb456fb8e99fa1ad164c44533fb99f5d9784a3f2a2f1b3096f89e589d263dca2f74411a19ee734f944c";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 126
    p_bin = (char *) "8060007e00009ab00000099d000001e0054e8c800521000335612ee5812e632045746f4aec21b0825f3d900e0bd3f2bd5cde0c9e5c8d8e35cd471d1f0c5e26610d8f868156fb78c6ea466e63a1b4cdfcb673309788cfe4c9245a7e2aac3146a9ea36caf5f6696ea864ad731e98fc44fb3370923d171144da12f55038ff90e910cd49c93e90da7fbb18df32c9c96de4a178c30ed9ceb99e1efb0c217c47737b21d51f5c4e42438cb77a5f21f5246f48b1bc216756d6f9657cf59b931bb1fcbdced18f5fb9489feb925629a6f8bb663936de5cf17c39ac838ec8874155bdf1779eb8c55fc4ddd55f3eb8855dbff1f1c93d32eb2b66906dc667f9a7c1c1da8ff132e4b7a4dc95f08699698e47c095e71831f6fcb84b90d65b5dd6f9ad3afc2741247da8d60affbdf7f1070f5c57b3925b47bf66634b1f371794e994eca63e26f2be4f9f12beae6dc95df29804dee7fcdcf57d9e5343cfad2e844bd9f3c64b5cbced2a45dcb9933aa6b55c49b2c86fec2cba62de6b0a1ed6adbd231c7ee40bf8aa51eedda7dfc4dd58edc3113cb5c9e1a695691640e3194bdbe63518374430dfb3b43473d32ffbb73df7beeb5aa65b929b6ff363a3059fe593afb4ac4bcfc99586dc315cd3f6f7c278cd8cf56d2fba52ed3e8b1b69db3bd04e3dab98e5b77f8eda667cb27749b7f920be8d27d6d9e2f25943ad53a7ded125179773eeb84cc6cc741e276c8dd6f5c41d9a46dd03486ff41f9a4933797bb755fc2572d1f24d656ad972f4f2b5edadcda2f3f64b9319bd9b5c246c38f7c59a0abadd75c41f0dffaa3fe65b7b9656175a1f1f8b5592c766a0da79a31413a134c72dfe6d649be6e3bab4c49cd4ae93e6e1b6e9cda25da6be12bc6b2d90eb46191d64b9f9a9d528b8ee50a3611ac1fc283eb5197c71a686f182d208febbe47c9c411a33854a54333911ce6bf2908cd49d9bf7d68e8d1861aa5ffc55a76b186b7d7cd8e9bcc47f73f776a97247e579e04e5a336b5f966bd24f5ae6d335c32f199726c4126b4cba248d458cf8a45ff246ee2af51b695d557e4968ad5ec2775b48e4f6be5e6b0e6246bdbf5f099a71e3ce98b37edfef5d9db4e563dccc1689fe26d333d68e5a99064ee5ecf5cdc773d7369a64aa6ae5e366b5784b5c39b162a8c81f7e3747cdba6d775bf928dcc30c7ee3b8a7df7592fe5d986acbdbf09e6353d95821ad5c6435bbbede9b2cc7481fc2d1a69924c1ff4999ff9b2b6d9cfdcaf8fc7ca6a7cbaa33e3797c9c9251825bee8cd59da4e6e37a437c973cac15df5c4573e209a1d8f4759384ef497630fb52272cf1dd734a6326fcb5cb8b9294d46c9cdb6915fe69a966896be20cf2d13d90daf6cec22d58ecbcdda2f6d7a9dba648517899f688d51f9cf72f2531b19d727756aeb96ef465e26127c1dac8569637c46b926dd25b1daeea9cf068fedb435cd721b4d8c77ae88625ed6e63ed17f88c61f48f6eb26122b49c5daba4d1797167daeed745e1d47ae12abd6a5977584e7cbf22be4afcd96e42897bb73e5ae8c61b1aa937e97424ece2662a38323840675796bf71ed63a68dbeeb44c7ae27aef48b7f923865dcbcbe3374fc9c77df96e91883aafcba67cdd6f8ae907b16b4cf9a7a89de3522577f1148bf355f3f2d9c7dad3f2f686593eeccbf7c9a9f15def09cc44973c8686dafe6c65e9aebbf8ba4c6dab9e8943f17486db8876a81223523bfd566f0de255544ca652747b27274d5eb977971a4f2e71016e3dc9a44edf6b63ad72f41425116848b1dc51f881092770d8ebab1b929f944b3664b9e8d8e3f5b61057247cdbecfcd5a60856a3f5a844cda61ffddb5fcf6ee3e62fcb3e55e3a37f8fe38455712f3d3690221eebd6e7d668bc77c6a2e6888b9adea2ef350d0b20c66c42d5d5a843661a9abeec20ccd5835acf964f5f8fcde018bea8f2f213725b272";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 127
    p_bin = (char *) "8060007f00009ab00000099d000001e0054e8c800521000335611cac6a96b2779fd5ea5e4e90dcb15ddea8ef6fee88a90e41df2f72d1f36a79d7eed357f34e5e591e49bee7317b572736a596f84b1318ee4f365b46d5725b39c7aaaf24cdda47e2ace7c1e3832aa562af132b8a25bc87c9b02af25ded351f7e6a694b4f173de91e18516d551ebb923baee5ceadd63a34a12456df929bdff6c6e21f66b2c56c5f3490476bcd25cba731f142302ad0d2273346934dfc4b7669f35a0d4fd3528fe6c63dfcb5e91e979a30d63a0fe5cc447502bafc41de75c8d77912ba535f84ecc6971a3057df98c4ddd3ccb762a223b2a1f335bccfdaacfa544848e7be076d32c21757c79bb6364b52b7741806ffa9da30df43cf9ce13d6343a4fe9bc67768979f931ccb92f7dd10de3abc6a97746cc94fdc60c7b0bcd9711cf66e6898c7c5d2635a58779737d9773efe4b064caaee38bf2731b195b7cc7b8659dd34b6c4f2f38aa2a468d35def26f926a3e166b89b39ff2b048d2e6cad611cff16624abdb7708362fe6f0c26f3508f3c0c6826eb0c9e93913d473d32b0e9d7921338eaed8247a9a27ab7dae38cdc6c62d416a671fb99d8e92bf22171ecdb978606bdb832bb2229e27102ded73b4b5d52f4b46eed9acec28dda4692f96f34508646a433649e6bb13c87c73aeba21078d8ae77fdd8c26f19c59e5eba69cbd73515cc77c94aefe4906289d9f92ce99987cdb4abbba0e33ea077448b1003276e98f04dc358dc0215f4fc9a896e732de2d54b7a171884bf29c83bde17df946f6c805590ac7f5dca2f92ba06bdd396b641b8e5ae4a1626dae7e38965a061bad6d931dff5c278fafa43f1fd7658718d797f84ae95f19a5fbb435edbe5bcf0aee6cb5d7e5e6a25ee6f65f26632ddf925c66934b9379f3c46a358a9a44a347c4ffe22c1ee3b9931bfe6b7969e229c97d235f972635f84edb6d1e2490dcc6b7c86d33655612f19de6812589eee3c73df243da6af45e3b3a33864c079815b11dd3b5eeaac8875e927dc1dcd67d9a34b3e4e4ebded96ac376962a6e0f6c1b9cb109d974f50858c9b719c6de9f725b1f6de20f4ae46187483a4e10f8e9706fc8457685a7226afe8fd8d57f9281a31d6e791f2d1a325f7784369d225a86a33e6e45b7f2533d103fa228e35b2eb1c8c6837e46255558562f166b5097dc54daf8bf03935e5bb9914355ff34a626d4718cec4da3537c588c0dcf8a97ec7bc66b8444a31d32097ed869ab6fc6993e9e1fd71aaf52089c413d199b8af0e2d4550c72cfdc23365521ee4296578f10de1d31eff4e0569d2de83c1a2423d3b2dd28db2e090efb09e0f52fac1a86c422f9fb35f97871e42f6fa52cd8eb7db8962048bbc033d2c3c5b0e27fb473d55897f3096704c66cad7e4d8dca4122f2d276687e4e6a9ab5789c3b5346e4d616f9633ee25bdc44e41248bb48ed4b67e59c82e80d2eab929ad3f2db5493ae82593a597504ad55d98d8de9486f67989b72f8895866bad51d8d59a2938a873bbc4e15727e5535cc669b2bee63077fc0dbbf9b3e3fe26d1b749051cfee63a74c6dbf72ee1bfb13040d6a17a3166e81be6c5a5fd6d14c54867697b38eb443868e908c508c70ecd18630c8677705224de95ca6cee2824f7e2d4a643236395b7c06a998268d5ccd2dbd1f5b989dbcb6c22156ae4afdf278de1830eb4ac8fd7ca1f533b3a31af50e238e8af9663b2077e97be33437103a6b5a362476980ef712792a49465a8e059e8e6097bbcfbf71f43f0ab9f586c7c155c4d4b5cbcb5d2aa046a7b01fdb1a88fd8dd088080fb0e5cadc3afed027bedef7b0d41f4841ab3aa48a777e06ae242adb08898c66f4ecccc116df5055b9a6c3a9cb9abc4b57cd4796adebe3952f8d55fb61bdc4d38129ead557ba95dbfd6a33acf07d32342f558a406e517cae167496af7";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 128
    p_bin = (char *) "8060008000009ab00000099d000001e0054e8c800521000335615aba681218c62c065a02ce9d38270a0b8f564cd374c1dff8bbe53643be103c1dcc4b95925ed156bc14bd7722a765bea229d962afef660c2fb70d0811d88ad8fe0a29d33c6a9fcfb1dc94c3ff5e14261ee6828af64ab228de5ad50b2d81a79adac50a117d0b83be07b3f0aec3f7e1c9d30f0a1f3d1a1df1203f4b850ec94bed7f97fbe6a8d5547eba5d72c6035a90261dd4a407b773b17775208e3ac29c733ec4de0a7b9c71411f48ef8bb8128704714038838fd0a2e4a5ba98ed51139d24cbd4d53812479682d549eee05a5d8b131bc3617ad5d8c9243b88ceb1fe4da3feeb35b2deae2293066953491b64aae2b2b4ef76b1bffbfdc637fb7b34f97be4968d3df3598e8d03d29f94d5a0a3df7cc7c3ab598e4637af35ccca2d4b1e64cfbb60a856d0cac87d529ac6478e072c5621de9ffb1ec6aa81df96d0b18c2aeb679f4d6392b84d1d3dbc39b01c7a69f7c3f0e31af56fd051068c13d05a6f6d1ac0c7b5903ac265f944e5c2e7bc972880de310ab4f3c22747d0a39098b4852632bc2c3e4d87057292a318c4b1968d46db83f2561069333c947a32120f9b56dab6c8b1cd57dafe119e88865b0377885a3e9cb05cc5152d6e48c8fbb966a1d34179c307e9f7debfa8c348e4e32d4b0a2a5b660acf3c76deb376248d5fa3504889f57da8f1028407a79adae04cf49f5520a75e18e4e123ed889642f5e619fa5bcbc190809c25f051df663b170e656157c2b6f4c4989588920ad52ed08dcc53337efcc5b6dcb1a30ea84351ee54d2359726e1ff86920d783ee781182d80245b0af9a87d79166a0397573629857a648aa9ab0ef18147ae615349048c136536dac53a7749f078419695a469e771acce8792f356105e498256e20b505dee5c8dbca7c01ffeb3b8356fa863d710c85bbadc3ff1c84c91a7a17271170d4aa147000bb93a6e6cc4688b0b649cdc9a54356c4e01d5a92fd30c3aedba9aa71df2f65aae339e035998eac111c5739f6b32fc2d40c7a93c92ac4479bbb0d88ecaba4b7cb08ca412d3369fecd29f19e3c5eb054237645adca5e077bd5404b0884983be0c967f19f2df242c98f10103c36ccbacf5f909fa4569946e85ff2d6215077382cb58729532f2099ed373155b96d3f76a6b67833eb6ebbe6d6caafdd590c872cce73cd606377388e63b693c5f2190d0744bbf77fee9e24bc4b2616d5f12c65139a5c74cea09c74d30e131ad376b18c8c9bfd78b8141fb9c48be43cff493eeea9882ae9406c19ac88249c6990f8d5deb2b147323cd32c2019e1ccd7dde1b3848c9d64f9415e279b522ff11fb6b5864e22701822c81d9fefc77c511b6e584881538420a89ce89ef5fac8edbb2a7b980aafea5bd47bdd08cddcaababcfc96777ded68545b1be072fd8605646b748553296f9aed15860879fe868a9ab0e874b1cc573b07c52555ee933f4ce3e419baf19d05bf8a8a54b08b61e2b2fa6a9cf5d226ab3c78301827bb7e2445eef6f0642855e6b3541830c485f104e1c103ec225d244d38ed4f777aa0422474cc1be4c3998cc453b4efe3e3f16d1e59bee4aae9da689b9cdc80a23ae0e9cf41d8460e9891e4dac37f9841da75ed39a08104c4c7b0a30e86a9d3b08971169a66a78228f593bcf20869a7d098d8bd4565c55a894ac208cc14666f3f29da3be8cb7ee239e84a9e0afa56bbc7aefd7e59a5aaef86189f5d7c561856718cd94e4eccc63f8d9bb3be5a0de12371aa9559d2af5265918d5709f9ba91ab5af2d4cffdc5b44fe3b4eb697eb2721c8ce6ebba756fdccc57e5a3766d279510473c8ff93a238c5dfe5469ac1d5767e5f05b7d59914f9a6fd0a6a465176d55642e337b4b4898aa88f9bfcb63b62ed2eecc211ba2ff66aa6b8349a88d41ea740be0fe2779bc4fccc5058805608";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 129
    p_bin = (char *) "8060008100009ab00000099d000001e0054e8c8005210003356172b72d33529a684cfd247259245c55bc610b2fbf02f0482321ca493db6878dc9167959994b8622147d386cc7dbef240b2356f718dc45d5e0d310314df92a5518aff84da72e58cf54712e2a8d37691b41a64df363f2d054cbc572e17099b51dbbd4477b23fd6c863cef2a5fa8896d19fe8c1fdf5f559794f9392848301c284277772584c62bb7e8d29aa8949d2247da285569d5cd8ec24b3cd0bba43cf95e6e2a68ece55309a235268110703838b325e6a61c0c7219e9b65cc48ce14fded627e9d588d9b4b1ac473198fff191e3ad0cc9b71ec398b4d4c5dd46296aafc75d4e97f9303241f54ef94d67375c51e7e965cd49c4d8c9e997c69fcb6919ef2772e5385b90c1dae6a5338f4a0c07343daae851af4adcdad3bbbbd5beabdafabf464442668366a493e5fc510b698436df41d6ba122578a4496c57d6e5a58c959a944b352d3e535eeddc9965637ae5350f3ff173d835e575b68ff02c82b2ea3feabcde39e272f2b0a2b65da2fc9cb2e27f973d9e7877513b91240c076aab688494421e7f9138feff5dedcbd0b625e9c34229ad75dae26da073e0d4a6cff5ebb11a8af5bee23cdffed608c1290d5037ed18bc1077baf2b2e339384e4c4c863abc98457fdeccc8a4f59b9a6736c370ff75bb9b92f77859cfd221adb6adfd2effd6f6ba3ee639cc21a8f473639a5a2be248e289d934e3bb5213d7aa8b9bb060d765b9b9888e35b5152df0cb7d165253121c6f571109dee61fdfd2077a5815c3248fe5a7cded9c9318b7e5123d5747ebe5b6cc6fdab8a96e5313b59addb3a972cbd1b4edd737356acd725d2a4b979a8be5e0ed8d193abee4fe6e7c6d5e17d4fca64dd37f1d77777bbddde6c7bc80fbad9cdbd2ee07fae04679852f78466a561b81c45da920e5a21b52e5da51810e2a8d557314a0edd5db71f0a84444e78e91a516e5cf98b6f2fd3289dcbc98cf5b6d796411c399a3bc6f9539c93c9434d35562ed1eea7b3dc27de89c41827b297a920fcdf0c7c320cf4c0ddf01dd51dc38dc63ea602c79e04e9fd258d1280eca6a9d69d39849f2d1b352cc246a75b112c3736a27ce845e6e1f7fd5e5ef30fa71f965ddfdca63a4df92ab6cdb97242fcda6865917929a77f1173b0eed3b0f1fc2466e2647b6b2fc1984c44b621a3596cf876c2c1a84c423e5e5c3ecd62f34a3c0f5223dd644fd55a4cd70030758cf37bfd870532665b79f65c8dfe24e9372d159c7690c6eb106f95e5a1496c9b45f5b2ebf909a44314408b8ddc84f464bc9d09792cd1cbf16f541811adf3617f13fa6240bd2c717883afab357def7f34d74da7cda6ed79233eef5924d46ea92776dd552ee239b53e7e2725bf362757931d3195c924a5acba9793b9702cd73536a771392865512e2e138c265bd91cbd0d34fc418ec3ed97fe5a72f7f253341cd3e0e42af56aa8cebaad44e7a50c45b2e52298970007382b3ae5c76359ad753c0bed6c59470a16272a4fd5b339aae225a4d8c7be5f7ae2b53082b871ca4efcf97b2f22e5ec4be8caabd56bfd882e5302bec028b99cf0f77d0aa6fcb691f25b246d653bca24929afe264acfee7a24d61f2d99a2cec5f2da365bf2d3cd4f172f4d34f1167e6962eb11cd4d534fcbbaa25cb6b35f97465a5418e4be66cfb93620ca9c9055afe4999dc8a7a81082427c067a9294b1a954cc2b8ad6b31a5098fcaf8db4ed938f69805352a38b57bc352d68b6ed10207a4332be08cce831ba7440b19a9e5108686bc65bef645ead041d34cbfc4082897ba7893f0a1855397de5866f130c7fbdb3106b2f631c83069ed6af89b796944434ff96c721a24b58be6a4af5c9a32c2313c865cac7b3da939f50868d352d4afbabc6c044030186fe128e26192799e2ec61bc9e6b812c10e6ead507d1110135a18";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 130
    p_bin = (char *) "8060008200009ab00000099d000001e0054e8c8005210003356101d78813f9d9192774f958eb5b80dcf105b1ea94749dd1e3edfe4b88fef6f69072136f72cc2e133a30150d916b8fbe4c0032cbdb80f739af65867be15dc28fd690b93c0aa0d448951755537af924c6361b5e5b4b2c92ddd2a0e3115f35a363d4b9b1ba32dea47d92912d2c2aeb92f1bc2769d3bcf92735a35315aaddec82317f02684c66f1a04de174da2cef4719e16f2282e6e373881cec79759806b74211a3d5f5e048040337b48bcfc5c40702855047b9a107979a540758871a1555dcc8261355485c4775b1040c587ff0abf8c65e89caf3b6e2f4c86d7fac0d1217f264b5dde0d84fe45038e85dd9345557acd2b7bdbdd22e42ee4b74764512e58536c3e5e1c47d0444bb71ba3370a0ce9c7bcfe0f43ac862d10403e955ad8211aff324d333ff2372db36b1e692aa82eeeea9556f96ccc94d0a3f7638fc581788935b4e6625ff268c66ac4b7ef96f35199794cb2db9dffbdeb13a88e63e3961ed35639f308119cf9665b15ed5809a060c20e6d473d659bc0aa0847eebd74446644be7a4563cfefc0aa08f30afaabd94c112e7ae1c118bf3ea9770144d8e8d93d8101c2f23cbffaf90b25188878ae66821b581894ecef5cf319bac35dd4c55379af971ce6892dc80c5a5efcfb43bbf94d76de38e448abac7c84c763215063111e2eed21b341323fd2f93b97b45ff9b3f2fdebabb3494ffbae26d4de954820f968a91689745d36ddbecb1af41f7cb3239e691d75372cf94a10ee2f6c7f05e5936ff24f7aae68cfb8beeadb3398f9bb89602f7e5f620c30be9564cb9317554f2a533143b9a7a49398f2be6a79aca99b09cb185ff97c7d4ed72d51aa89e69582418166a9ac0da330ab0b9a7cb5f265a0bd208715966ca236f484a4baee8c7ffa6bbdb76c952522666d56eb963da7c8fbf90cb56bd9f1bed3ee2f5f725bfe5968a81faf965c634be4a526fdf1d41823e5ba6529be58de51358d77bab7e6b574c62ff45a8affbe5932a87e5ab64f36c3562b5517aaadf52778cb4bd4eb11cd1dee1a3096e37b371bc1794f648c6623cd96ee96d5eef965b967f2c773ae6b92318ff934a7d572c8ccb4b995774a6f6bfe27527f35a77e4e2fb9708d5569ad4945fe26cfa6b55331c812aaaad4d8ce9dd7cdb6e90be4d836865abe12b958cadd56a3f974cf48611e6a6955dc559e7ece90ccefacbdcee3bf7cd971f5addfd64d7cd465ca4b93689f22ff92b55f132310735a6aab1dcb29168ac3ad72d5daf9ace4c48572523e616b925639e9eeb86773d7cd6d5a4c97be5b632d1af788a73ec865aad7df31ec21dfbf9abf2decc9af88c94b6f69aaafb9ad4fb7cdb1a99be27274b93d31697863966d439ff9a98d0c6db4405f797be4e4928db091e9faaee93334a046d12a374ebbea59a55d5754f4fbf92e3faf7dd1aba3f7a9690fdd65bbee95afc968f9a92f39246e60bcd576db11cd93d35c96dda8634e8669a73e26ccff6117dc472d4ec9b35dcf4a5752482024396fdcf88eb96a6b4cda6895b4b55cdba6d796d0fb5d47efb96c9cdcd868d694577b725be6f1ccd72654a4fae6a72ea0615dfdd8c96cff7cf46c9cb15ec2d7e2d691320ed7f8427c4b196fdf652383eb1adf95e19e39eae25e5db3ca0d72cfd5175f965223c6a539f924ba77dd147a57ddf13077cd165e7365d495ae4b6f6babb966658deb97b44eb8479fb2486d5277e25f5cd6e7f4f70978ed8351b9a2977050bbf95329b19d2b8863b512feaf94b0854c7d6d9fb4c9ee9a2f232c1d3fbd4df272496825abc9c91e8d61bef8ab9a9554a6b2adb3567944734d84776bd734db4699392ad9bdf52b5fe4908366be5b9482f00c23c27249e9377717abe6bd549dd72d0dcd9edadbfebf094f8c754396052efbd90fd989f35f198ff34eea6a2";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    // seq 131
    p_bin = (char *) "80e0008300009ab00000099d000001e0019c8c80052100033561b9ad2689fb35b9acf423dada6b5c9a1a66cf2ef1fa0ceee5a4d417b374cb419cb197d71cf7aadde6e6c9952776923e6fbbcf1f88e3631be435a43ed566ddcb9ef249938e2d7abbc4f3546e2168c21c9cc949126e5e2e19729b3e6aee74f9ba67e25ff5dbfdfe2ab21048666f435b1721b6c96c20a2415b979a544b4fc448e977666d889cb34da572336a2b9aaf331e5cc44b7432725e927e48c77df768f895938b8cc6c3a36db7b896fcfdd29b3e2b6e3fd742557e4b397c57172e524cd54e2d3f5df4cbcf7e9d35eb9291eec2f77bb3272de48572e43196df24c628cd9be5a19208ebefd1a5d4367f7a063431c64e58dfbef8ad37725b313df74de4c7c251d5e8f8eac6ea5bddc24b58fa971ec74fb27276c772acba58f9a68c770c23e58fcab88844abb95afebdfcb63b47ef919fa9dd0cbcb6359ba52d7cb6aeebbd97d177f2748b85eec76cf52f35a43764b9b451e902cdf25d6ab92d15c667f2dd378d5c708a3c7346530d54fc89aa503ff19a97919a9a6fbc73dc9c92c104f53e6e4e5a18482fc9968d62f9286ef0af3648a0a5f74b2e92";
    memset(arr_payload, 0x00, sizeof(arr_payload));
    CU_ASSERT_EQUAL(apmtest_hex_string_to_bin(p_bin, arr_payload, sizeof(arr_payload)), FR_SUCC);
    ui_payload_len = strlen(p_bin) / 2;
    p_st_packet = NULL;
    CU_ASSERT_EQUAL(apmtest_create_apm_packet(&p_st_packet, arr_payload, ui_payload_len, TEST_RTP_SRC_IP, TEST_RTP_DST_IP, TEST_RTP_SRC_PORT, TEST_RTP_DST_PORT, st_timestamp), FR_SUCC);
    p_st_packet->i_direction = FR_DIRECT_SRV2CLIENT;

    CU_ASSERT_EQUAL(frhash2_create(&st_hash_report, 2), FR_SUCC);

    p_st_conn->flg_has_master = FR_YES;
    p_st_conn->st_masterInfo.exp_src_ip = iptools_parse_ipaddr(TEST_RTP_SRC_IP);
    p_st_conn->st_masterInfo.exp_src_port = TEST_RTP_SRC_PORT;
    p_st_conn->st_masterInfo.exp_dst_ip = iptools_parse_ipaddr(TEST_RTP_DST_IP);
    p_st_conn->st_masterInfo.exp_dst_port = TEST_RTP_DST_PORT;

    unsigned long ul_invite_begin_timestamp;
    struct timeval st_timestamp_first;
    st_timestamp_first.tv_sec = 1454549154L;
    st_timestamp_first.tv_usec = 112233L;
    ul_invite_begin_timestamp = rtp_get_timestamp(&st_timestamp_first);
    char arr_invite_time[32] = {'\0'};
    snprintf(arr_invite_time, sizeof(arr_invite_time), "%lu", ul_invite_begin_timestamp);
    p_st_conn->st_masterInfo.p_lst_hdr_param = frlist_create();
    p_st_field = frvarfield_str(APM_SIP_INVITE_BEGIN_TIME, arr_invite_time);
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    p_st_field = frvarfield_str(APM_SIP_INVITE_PLAY_URI, "sip:42010606001320082255_1@10.72.1.125");
    p_st_node = frlist_node_create(p_st_field);
    frlist_push(p_st_conn->st_masterInfo.p_lst_hdr_param, p_st_node);

    CU_ASSERT_EQUAL(rtp_analyze(p_st_conn, p_st_packet, &st_hash_report), APM_L7_ANALYZE_SUCC);

    // 测试结果
    Frlist_header *p_list_report = NULL;
    Frlist_node *p_st_node_report = NULL;
    p_list_report = &((&st_hash_report)->p_list_array[0]);

    p_st_node_report = FRLIST_FIRST_NODE(p_list_report);
    CU_ASSERT_PTR_NULL(p_st_node_report);

    frhash2_free(&st_hash_report, list_report_node_free);

    apmtest_destroy_apm_packet(&p_st_packet);
    CU_ASSERT_PTR_NULL(p_st_packet);

    test_rtp_destroy_ct(&p_st_conn);
    CU_ASSERT_PTR_NULL(p_st_conn);
}

int add_suite_rtp_analyze(void)
{
    CU_pSuite pSuite = NULL;

    if ((pSuite = CU_add_suite(MODULE_NAME" rtp_analyze()", __suite_init, __suite_cleanup)) == NULL)
        return FR_FAIL;

    if (CU_add_test(pSuite, "case1", __case1) == NULL ||
        CU_add_test(pSuite, "case2", __case2) == NULL ||
        CU_add_test(pSuite, "case3", __case3) == NULL ||
        CU_add_test(pSuite, "case4", __case4) == NULL ||
        CU_add_test(pSuite, "case5", __case5) == NULL)
        return FR_FAIL;

    return FR_SUCC;
}
